Giter Site home page Giter Site logo

Scrollable on entire page about ngdialog HOT 7 CLOSED

likeastore avatar likeastore commented on August 19, 2024
Scrollable on entire page

from ngdialog.

Comments (7)

natehaefner avatar natehaefner commented on August 19, 2024

I have made a workaround, but it requires a different structure for the dialog itself. Basically you need to make the ngdialog-overlay a parent of the ngdialog-content and apply the overflow:auto to the overlay instead of ngdialog.

So in the source code I changed the the line:

$dialog.html('<div class="ngdialog-overlay"></div><div class="ngdialog-content">' + template + '</div>');

to

$dialog.html('<div class="ngdialog-overlay"><div class="ngdialog-content">' + template + '</div></div>');

and the css became:

.ngdialog {
  position: fixed;  
  z-index: 10000;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
}

.ngdialog-overlay {
  position: fixed;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: rgba(0, 0, 0, 0.4);
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  -webkit-backface-visibility: hidden;
  -webkit-animation: ngdialog-fadein 0.5s;
  animation: ngdialog-fadein 0.5s;
}

from ngdialog.

bgse avatar bgse commented on August 19, 2024

We had a similar issue, but the main problem for us was the fact that the overflow scrollbar was being obfuscated by the overlay.

Users would be able to scroll with the cursor inside the dialog, but could not use the scrollbar.

I've fixed this by simply giving the ngdialog-overlay class to the main ngdialog element instead of having it nested inside:

self.$result = $dialog = $el('<div id="ngdialog' + globalID + '" class="ngdialog ngdialog-overlay"></div>');
$dialog.html('<div class="ngdialog-content">' + template + '</div>');

No further changes were necessary to make it work as we excpected it to.

This will allow interaction for the scrollbar, and also fixes your issue I believe. I haven't extensively tested this with the original themes though, as we use our own custom themes.

from ngdialog.

sejoker avatar sejoker commented on August 19, 2024

@voronianski the issue with scrolling is reproduced in the latest 0.3.11 version, is it regression bug? I could make PR with similar fix that @bgse did.

from ngdialog.

lagr avatar lagr commented on August 19, 2024

@sejoker A non-intrusive fix that uses the mechanism of @bgse's solution would be to add ngdialog-overlay to the className option and disabling the overlay via option. I have not tested this in depth, but it works quite well for me.

ngDialog.open({
          template: '...',
          className: 'your-custom-classes ngdialog-overlay',
          overlay: false,
          controller: [...]
        });

from ngdialog.

sejoker avatar sejoker commented on August 19, 2024

@lagr thanks I also implemented similar aproach in my project. I was interested in adding the fix into the main branch.

from ngdialog.

andriytkachiv avatar andriytkachiv commented on August 19, 2024

Please fix it, this bug is really annoying :(

from ngdialog.

zaidiqbalvf avatar zaidiqbalvf commented on August 19, 2024

Bug is still open for iPhone Webkit. I am getting this issue on iOS Hybrid app

from ngdialog.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.