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

DragHandle positioning #15

Closed
2 tasks
YousefED opened this issue Mar 9, 2022 · 2 comments
Closed
2 tasks

DragHandle positioning #15

YousefED opened this issue Mar 9, 2022 · 2 comments
Assignees

Comments

@YousefED
Copy link
Collaborator

YousefED commented Mar 9, 2022

We need to clean up the position of the draghandle:

  • Fix vertical position: the draghandle is now too far to the top. Check for both headings and regular elements
  • Fix horizontal position (see below)

Horizontal position
The draghandle now displays right before elements, even when they are indented. This is ugly as it overlaps with the vertical line ("the indentation guide").

Design-wise; I don't think there's an easy option where we can have both indentation guides and a draghandle right next to the block.

So there are two options here:

a) remove indentation guides (notion also doesn't have this, it's more inspired by Roam) and display draghandles right next to the element similar to Notion
b) always show the draghandles on the left side of the document (so at the same horizontal position as root-level elements)

image

Preferably, indentation lines can be configured by the consumer library, and if enabled we show Draghandles at position B, otherwise at position A

@YousefED
Copy link
Collaborator Author

YousefED commented Mar 22, 2022

@17Amir17 This currently breaks when resizing the window:

image

@17Amir17 17Amir17 reopened this Mar 22, 2022
@17Amir17
Copy link
Collaborator

17Amir17 commented Mar 22, 2022

The issue here is that the horizontal anchor is calculated when the window is opened and then is never changed. I can listen for resize events and recalculate the horizontal anchor and this would partially solve the issue. The issue remaining is that the draghandle will render into the new position only after the mouse moves again. To fix this we need to create a transaction each resize event and render the draghandle again ( I think this requires us to move the render function from the plugins props to plugins update) What do you think @YousefED ?

@YousefED YousefED closed this as completed Feb 7, 2023
fogle pushed a commit to fogle/BlockNote that referenced this issue May 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants