-
Notifications
You must be signed in to change notification settings - Fork 94
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
Position menububble relative to content-wrapper #1903
Conversation
Might be one of the things that tiptap has resolved on the v2 release as the new bubble menu component seems to dynamically align at the top or bottom of the selected text, depending on the available space: https://tiptap.dev/examples/menus |
Actually we can make use of ueberdosis/tiptap#459 it seems so we'd just need to either use top or bottom depending on if the menububble fits the available space to the menu bar. |
ef6636a
to
750fe80
Compare
in the viewersecond linefirst linein the workspace in filesfirst linesecond line - slightly too highI suspect the size of the |
1a8f340
to
0b19101
Compare
Add a `position: relative` to `content-wrapper` to fix misalignment of the menububble. The menububble has an absolute position which is calculated by tiptap based on the position of the highlighted text. It is styled with `left` and `bottom` attributes. These are relative to the position of the `.content-wrapper`. Signed-off-by: Azul <azul@riseup.net>
For the rest of the text we keep the position above. Signed-off-by: Azul <azul@riseup.net>
In rich workspaces scrolling still made the menu-bubble render at the wrong place. The element that the absolute position of the menu-bubble is relative to needs to grow with the text so tiptap can position the menu-bubble correctly. Now we also do not need the margin bottom anymore. Signed-off-by: Azul <azul@riseup.net>
Signed-off-by: Julius Härtl <jus@bitgrid.net>
0b19101
to
8dddfc7
Compare
Took the liberty to push a lint fix and rebase ;) |
/backport to stable22 |
/backport to stable21 |
The backport to stable22 failed. Please do this backport manually. |
The backport to stable21 failed. Please do this backport manually. |
/backport to stable21 |
/backport to stable22 |
The backport to stable21 failed. Please do this backport manually. |
The backport to stable22 failed. Please do this backport manually. |
* roll back parts of #1903 that broke it again. * Calculate top of menububble based on scrollHeight of content-wrapper. * Always display menububble below selected line. This will make it less likely to conflict with the menubar or mobile copy and paste toolbars. * Add cypress tests for the workspace.
* roll back parts of #1903 that broke it again. * Calculate top of menububble based on scrollHeight of content-wrapper. * Always display menububble below selected line. This will make it less likely to conflict with the menubar or mobile copy and paste toolbars. * Add cypress tests for the workspace. Signed-off-by: Azul <azul@riseup.net>
* roll back parts of #1903 that broke it again. * Calculate top of menububble based on scrollHeight of content-wrapper. * Always display menububble below selected line. This will make it less likely to conflict with the menubar or mobile copy and paste toolbars. * Add cypress tests for the workspace. Signed-off-by: Azul <azul@riseup.net>
* roll back parts of #1903 that broke it again. * Calculate top of menububble based on scrollHeight of content-wrapper. * Always display menububble below selected line. This will make it less likely to conflict with the menubar or mobile copy and paste toolbars. * Add cypress tests for the workspace. Signed-off-by: Azul <azul@riseup.net>
* roll back parts of #1903 that broke it again. * Calculate top of menububble based on scrollHeight of content-wrapper. * Always display menububble below selected line. This will make it less likely to conflict with the menubar or mobile copy and paste toolbars. * Add cypress tests for the workspace. Signed-off-by: Azul <azul@riseup.net>
* roll back parts of #1903 that broke it again. * Calculate top of menububble based on scrollHeight of content-wrapper. * Always display menububble below selected line. This will make it less likely to conflict with the menubar or mobile copy and paste toolbars. * Add cypress tests for the workspace. Signed-off-by: Azul <azul@riseup.net>
* roll back parts of #1903 that broke it again. * Calculate top of menububble based on scrollHeight of content-wrapper. * Always display menububble below selected line. This will make it less likely to conflict with the menubar or mobile copy and paste toolbars. * Add cypress tests for the workspace. Signed-off-by: Azul <azul@riseup.net>
* roll back parts of #1903 that broke it again. * Calculate top of menububble based on scrollHeight of content-wrapper. * Always display menububble below selected line. This will make it less likely to conflict with the menubar or mobile copy and paste toolbars. * Add cypress tests for the workspace. Signed-off-by: Azul <azul@riseup.net>
* roll back parts of #1903 that broke it again. * Calculate top of menububble based on scrollHeight of content-wrapper. * Always display menububble below selected line. This will make it less likely to conflict with the menubar or mobile copy and paste toolbars. * Add cypress tests for the workspace. Signed-off-by: Azul <azul@riseup.net>
Summary
Add a
position: relative
tocontent-wrapper
to fix misalignment of the menububble.
The menububble has an absolute position
which is calculated by tiptap
based on the position of the highlighted text.
It is styled with
left
andbottom
attributes.These are relative to the position of the
.content-wrapper
.