Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modal registers scroll bar click as backdrop click and closes #5810

Open
andre-gois opened this issue Jun 8, 2020 · 10 comments
Open

Modal registers scroll bar click as backdrop click and closes #5810

andre-gois opened this issue Jun 8, 2020 · 10 comments

Comments

@andre-gois
Copy link

Modal registers scroll bar click as backdrop click and closes. On modals with long content I can scroll with the trackpad and/or mousewheel just fine, but when I click and drag the browser's scrollbar the modal closes.

Happens on the documentation page: https://valor-software.com/ngx-bootstrap/#/modals#scrolling-long-content

ngx-bootstrap: 5.6.1
Angular: 9

@thanhdn1989
Copy link

Modal registers scroll bar click as backdrop click and closes. On modals with long content I can scroll with the trackpad and/or mousewheel just fine, but when I click and drag the browser's scrollbar the modal closes.

Happens on the documentation page: https://valor-software.com/ngx-bootstrap/#/modals#scrolling-long-content

ngx-bootstrap: 5.6.1
Angular: 9

i raised this issue long time ago and it still there on the newest version

@Basketblo
Copy link

The same issue here, in vanilla Bootstrap everything works fine, but with ngx-bootstrap I could reproduce an issue even in example on the website: https://valor-software.com/ngx-bootstrap/#/modals#scrolling-long-content

ngx-bootstrap: 5.6.1
Angular: 9
Browser: Chrome 83.0.4103.61 (Official Build) (64-bit)

@andre-gois
Copy link
Author

andre-gois commented Jun 19, 2020

If I try to change the version of the exemple website the problem start happening in release 5.5.0 (https://valor-software.com/ngx-bootstrap/old/5.5.0/#/modals#scrolling-long-content), 5.4.0 was fine (https://valor-software.com/ngx-bootstrap/old/5.4.0/#/modals#scrolling-long-content).
For now maybe a downgrade could be an option for some projects.

@FirassKoubaa
Copy link

is there any news fo this bug ??

@Hleb-Chupin
Copy link

How are the things today?

@florenthobein
Copy link
Contributor

It seems there is a duplicate of this issue on #5893 that provides a fix in the commit 87e7df8e9bdf5d7269bc3727286f2576a2a4273e
Could we perhaps merge it for the next release? It is really an irritating bug for my clients.

@florenthobein
Copy link
Contributor

florenthobein commented Jan 27, 2021

My bad, it seems the fix proposed doesn't actually work.

When looking more into the problem, it appears that on some browsers (for ex Chrome 87 on mac) the scrollbar appears above the content without modifying the layout, thus equating scrollbar click and backdrop click.
The reason why this bug is relatively new is that, when clicking on the scrollbar, the events mousedown and mouseup fire, but not click, and the use of mousedown & mouseup has been introduced in the fix #5326 .

Coincidentally other librairies relying on bootstrap seem to have had the exact same problem, and have fixed this issue by replacing mouseup by click. That seems to do the trick for me, I'll propose a PR with this solution.

@Hleb-Chupin
Copy link

Any news on that case?

@florenthobein
Copy link
Contributor

@Hleb-Chupin the fix has been merged, it will be available in the next version of the library (I suppose)

@ViralDPatel
Copy link

Still issue in version 8.0.0, showing merged but still not working in current version, last working in version 5.4.0 then after issue in all versions, this is critical issue, large height modal is not usable without fix, need to take as priority and release in next sub version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

8 participants