Opened 11 years ago
Last modified 11 years ago
#10829 confirmed New Feature
CKEditor should prevent page to scroll by mouse wheel when focused.
Reported by: | heaven | Owned by: | |
---|---|---|---|
Priority: | Normal | Milestone: | |
Component: | General | Version: | |
Keywords: | Cc: |
Description
Hi, it is a pretty annoying behavior. Each time I need to reach the end of a large document and it starts to scroll the page. The work becomes a hell, lots of users complain on that.
The correct behavior:
- CKEditor should not capture scroll events until focused. So when user simply move cursor over it and scrolls it should not have any reaction and the page should scroll instead (as it shoudl by default).
- When focused it should scroll only current editor's area and prevent events to reach the document. If user will need to scroll the page it is possible to move mouse out from the editor and scroll.
That way users will not be afraid to use mouse wheel on the page. If they need to scroll the page — they'll be able to do so as usual. But when they work with an editor they will also be able to use mouse wheel safely, without moving the page.
Also, my browser does support smooth scrolling (google chrome with additional plugin), which does not work because of all currently applied hacks. Let browser manage scrolling and only do evt.stopPropagation() if @active so it will only scroll the editors area.
Please see the example video. I have to scroll each(!) ckeditor element to reach end of the page when I didn't event touch them. In other case, if I was working with specified document in the CKEditor and only was need to reach end of that document I would usually do a few very fast mouse wheel scrolls, but currently it will not work either, since it will reach end of document in editor and then reach end of the entire page. So both behaviors are broken.
Change History (6)
comment:1 Changed 11 years ago by
comment:2 Changed 11 years ago by
It does work exactly how it should when browsing document source. Example: http://www.youtube.com/watch?v=3nHrhwZsx5M
comment:3 Changed 11 years ago by
Status: | new → confirmed |
---|---|
Type: | Bug → New Feature |
I'm confirming this, but not as a bug, but a new feature request. Current behaviour is controlled by browsers and this is how they work and how everywhere else in the web scrolling works.
BTW. It's not possible to block scroll by preventDefault or stopPropagation. We would need some tricky hack to achieve this.
Also, please report separate issue for this if you feel that something is wrong:
Also, my browser does support smooth scrolling (google chrome with additional plugin), which does not work because of all currently applied hacks. Let browser manage scrolling and only do evt.stopPropagation() if @active so it will only scroll the editors area.
But we would need more details because we need to be able to reproduce the issue.
comment:4 Changed 11 years ago by
Hi, yes, agree with you, it could be considered as a new feature since nothing is significantly broken.
I don't think you should implement anything to support smooth scrolling or something else, just leave the browser to do the job.
Please take a look: http://www.youtube.com/watch?v=UTZurYM7qGM
An example page with an iframe element.
You can see that it does not scroll the entire page when I reach the end of iframe's content. The browser handles that well out of the box, so basically you can do nothing for scroll. The one problem is that it starts to scroll even when the element is simply hovered by mouse, but that's something I can live with, plus it does match default browsers behavior for text areas and other "scrollable" elements. And this should be reported rather to browser developers that CKEditor.
Counting that users chose their browsers based on some criteria I think it will be ok if CKEditor's scroll will work differently per browser, but will match browser's default behavior.
Plus this could be made optional, e.g config.use_native_scroll:boolean. So if true you will disable the JS module that currently handle the scrolling functionality. That would be perfectly and users who like current behavior will be happy also.
Best, Alex
comment:5 Changed 11 years ago by
Same thing with dropdowns, they also do not prevent page from scroll.
comment:6 Changed 11 years ago by
#8170 was marked as duplicate.
Some links to script that perhaps might help:
http://stackoverflow.com/questions/4770025/how-to-disable-scrolling-temporarily
http://stackoverflow.com/questions/3898130/how-to-check-if-a-user-has-scrolled-to-the-bottom[[BR]]
http://stackoverflow.com/questions/1930875/disabling-middle-click-scrolling-with-javascript
In this ticket: http://dev.ckeditor.com/ticket/8170 The original message was correct, except one thing — CKEditor should only have reaction on scrolling event if it is in focus.
The second message, especially: "All should be enabled again when scroll in editor has reached the bottom." is completely wrong and deprived that ticket of its meaning Once focused CKEditor should capture all scroll events and prevent page from scrolling (except the cases when mouse is not over the editor, of course).
The example video was too big thus uploaded to youtube: http://www.youtube.com/watch?v=ZzAz0h_Jhio