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

Marks cannot be untoggled in table cell selection if head cell is empty #1947

Closed
anna-holmes opened this issue Sep 27, 2021 · 2 comments
Closed
Labels
Type: Bug The issue or pullrequest is related to a bug

Comments

@anna-holmes
Copy link

Description
After selecting some cells in a table, any mark you attempt to toggle (with toggleBold, toggleItalic, etc) will not toggle off correctly IF the last selected cell does not have any content.

By "last selected cell" I mean the head cell -- this issue happens whether or not the last selected cell is above the first selected cell in the table.

Steps to reproduce the bug
Steps to reproduce the behavior:

  1. Go to https://codesandbox.io/s/tiptap-issue-template-forked-3xzhz?file=/src/components/Tiptap.vue
  2. Click "insert table"
  3. Type some words in the left-top and left-center cells
  4. Highlight all 3 cells in the left column
  5. Click "toggle bold" twice
  6. Notice that the content was bolded correctly but not unbolded on the second click

Expected behavior
If you create a cell selection in which all cells with content have a particular mark applied, toggling that mark should cause it to be removed in each of those cells.

Screenshot, video, or GIF
https://user-images.githubusercontent.com/46762176/134964945-ad4d61a6-a6e4-420d-9ef7-26ca735a927e.mp4
https://user-images.githubusercontent.com/46762176/134965224-78d6e4d5-9ba4-4a7d-8344-c4fc4f21bd5a.mp4
https://user-images.githubusercontent.com/46762176/134965502-cf7ef9c8-b53a-402d-b211-1bf15c98d765.mp4

Environment?

  • operating system: Big Sur
  • browser: Chrome
  • mobile/desktop: Desktop
  • tiptap version: 2.0.0-beta.105

Additional context
I'm thinking this might be a Tiptap issue and not a ProseMirror issue, because this issue doesn't occur in this basic ProseMirror table sandbox https://codesandbox.io/s/3gmyc?file=/src/index.js

@anna-holmes anna-holmes added Type: Bug The issue or pullrequest is related to a bug v2 labels Sep 27, 2021
@anna-holmes anna-holmes changed the title toggleMark does not unset mark in table cell selection if head cell is empty Marks cannot be untoggled in table cell selection if head cell is empty Sep 27, 2021
@hanspagel
Copy link
Contributor

3 hours for a bug fix, not bad @philippkuehn

@anna-holmes
Copy link
Author

Amazing! Just pulled this down and it's working perfectly (of course)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug The issue or pullrequest is related to a bug
Projects
None yet
Development

No branches or pull requests

2 participants