framework7io / framework7

Full featured HTML framework for building iOS & Android apps
http://framework7.io
MIT License
18.13k stars 3.23k forks source link

[Bug ? Feature Request ?] Texteditor-Popover is incorrectly positioned #3617

Closed Pitouli closed 4 years ago

Pitouli commented 4 years ago

Describe the bug

The css position of the texteditor-popover is relative to the .framework7-root element, but it seems it is calculated relative to the html element. Therefore, If the dev limit the size of the body element (for example on big screens), then the popover is incorrectly positioned

To Reproduce

Steps to reproduce the behavior:

  1. Go to https://jsfiddle.net/y95raxdj/
  2. Type then select text to make the popover appears
  3. Observe that it is offset as much as the red padding

Expected behavior

Since the popover is relative to the .framework7-root element, the top and left position should be computed accordingly. Note : even better (but more complex), the popover should be relative to the text-editor element, so it scrolls with it.

Actual Behavior

top and left are computed relative to html element.

Additional context

It's not really a bug since resizing the app is not part of Framework7. But I believe it's a common need (on 21:9 screens, having the app fullwidth is not very elegant), and since it's not very hard (substract the position of the .framework7-root to the element coordinates), it could be a good improvement! :)

Pitouli commented 4 years ago

Since I'm opening thousands of tickets, and this one is a modification I'm skilled enough to do, I thought it would be better to write the PR myself!

nolimits4web commented 4 years ago

Fixed by #3618