quill icon indicating copy to clipboard operation
quill copied to clipboard

image-tooltip module causes over scrolling if the editor's height is < 300px

Open jasongisstl opened this issue 11 years ago • 4 comments

If you include the image-tooltip module, the image preview window is added to the container (off-screen).

On Chrome this is fine, but on Edge & Firefox it factors into the overflow-y calculations and causes the editor to become scrollable to the bottom of the image preview window. If the editor is shorter than 300px (the image preview window's height) this is a problem.

Please see this JS Fiddle in FF/Edge/IE - And notice that the vertical scrollbar is displayed from the start, and you can scroll past the bottom of the editor.

The issue is more obvious on Windows as the scrollbars are permanently displayed.

Perhaps when the image preview is not on screen, it could be set to display: none; ?

jasongisstl avatar Oct 05 '15 09:10 jasongisstl

Dimensions are not accurately calculated with display: none so the offscreen position is the workaround. What is the use case here though? When the tooltip is visible and on screen the overflow scrolling would still be an issue.

jhchen avatar Oct 06 '15 20:10 jhchen

Thank you for your reply, Jason.

The use case is creating an editor which is shorter than 300px. I assume this is not a particularly unusual use (especially for mobile pages)?

I think the overflow would be fine while the tooltip is visible, as it is then obvious as to why it is scrollable. It may even be necessary, as the tooltip has a fixed height, so you may need to scroll to view it all?

jasongisstl avatar Oct 06 '15 21:10 jasongisstl

The image tooltip could be better optimized for mobile. I think for now the best workaround is just make the toolbar shorter with css (which may be desirable for your app anyways).

jhchen avatar Oct 14 '15 22:10 jhchen

Module containers are no longer confined within the editor and do not affect its scroll overflow in the 1.0 beta release

jhchen avatar May 04 '16 07:05 jhchen