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

fix(ui-markdown-editor): fixes cursor movement around headings - I260 #262

Closed
wants to merge 2 commits into from

Conversation

d-e-v-esh
Copy link
Contributor

@d-e-v-esh d-e-v-esh commented Feb 23, 2021

Signed-off-by: d-e-v-esh [email protected]

Closes #260

  • Before: The cursor would jump one line above when we would press enter from the beginning of any heading text

r91hU4x2ti

  • Now: It works as expected now and stays in the same line

CAeWDpfbXi

Changes

+ Transforms.move(editor, { distance: 1, unit: 'character' })

Related Issues

Author Checklist

  • Ensure you provide a DCO sign-off for your commits using the --signoff option of git commit.

  • Vital features and changes captured in unit and/or integration tests

  • Commits messages follow AP format

  • Extend the documentation, if necessary

  • Merging to master from fork:branchname

  • Manual accessibility test performed

    • Keyboard-only access, including forms
    • Contrast at least WCAG Level A
    • Appropriate labels, alt text, and instructions

@d-e-v-esh
Copy link
Contributor Author

@irmerk Is this ok now?

@jolanglinais
Copy link
Member

Looks like it! Still want to change the commit and PR title to our format.

NOTE: This is built off #261

@d-e-v-esh
Copy link
Contributor Author

@irmerk I'll get to that tomorrow for sure. Really appreciate the help.

@d-e-v-esh d-e-v-esh changed the title insertHeadingbreak Bug Fixed fix(ui-markdown-editor): fixes cursor movement around headings Feb 24, 2021
@d-e-v-esh
Copy link
Contributor Author

@irmerk Is the title good?

@Michael-Grover
Copy link

It looks like the cursor still jumps to the line above the heading if you refresh the page and don't click anywhere, then press enter. See the recording for more detail

https://www.loom.com/share/ec48136714d44e218d12f00bc29b7b50

@d-e-v-esh
Copy link
Contributor Author

@Michael-Grover That is true... Do you have any idea what might be causing the problem? Can it be some memoized value that gets updated when we interact with the site?

@jolanglinais jolanglinais changed the title fix(ui-markdown-editor): fixes cursor movement around headings fix(ui-markdown-editor): fixes cursor movement around headings - I260 Feb 24, 2021
@jolanglinais
Copy link
Member

That could be the case. This might even be a bug deep within Slate, it could be useful to check there.

@d-e-v-esh
Copy link
Contributor Author

@Michael-Grover @irmerk It might be some sort of bug in Slate at someplace, but in this case I think I have found what is causing the main problem and it mostly fixes all the issues.
I want to know what is the intended purpose of having a separate headingBreak function that would be different from a linebreak. All I can gather up is that it adds 2 lines on the press of enter from any heading (H1, H2, H3) instead of just one. Is that all or am I missing something?

@jolanglinais
Copy link
Member

I'd have to look into it further, but I believe that comes from #220

@d-e-v-esh
Copy link
Contributor Author

d-e-v-esh commented Feb 25, 2021

@irmerk Thanks! I think I fully understand it now. Working on fixing this.
This issue and #263 occur from the same problem.

Copy link
Contributor

@dselman dselman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you.

Copy link
Member

@jolanglinais jolanglinais left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Observations from @Michael-Grover here still need to be fixed.

@d-e-v-esh d-e-v-esh closed this Feb 26, 2021
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

Successfully merging this pull request may close these issues.

Enter on Heading Text - Cursor Jump
4 participants