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

Add class to table row makes table block locked and unusable #21887

Closed
kebbet opened this issue Apr 25, 2020 · 2 comments
Closed

Add class to table row makes table block locked and unusable #21887

kebbet opened this issue Apr 25, 2020 · 2 comments
Labels
[Block] Table Affects the Table Block [Type] Bug An existing feature does not function as intended

Comments

@kebbet
Copy link
Contributor

kebbet commented Apr 25, 2020

Describe the bug
While editing the Table-block in HTML, I try to add a class by class="xyz" to any tr or td. Then the block is locked, and I can not continue editing the block as expected. When I then press the buttons "Konvertera till HTML" and "Lös upp" (Convert to HTML and Dissolve) nothing happens in the browser. I'm stuck.

To reproduce
Steps to reproduce the behavior:

  1. Go to any page or post
  2. Click on Add table block
  3. Create a table with 2 column and 4 rows.
  4. Add dummy content to all cells.
  5. Click the "Edit as HTML-option" for the block
  6. Add class="xyz" to any tr or td.
  7. Click outside block.
  8. See error in console.
  9. Try to click the two buttons in the table-block. Nothing happens

Expected behavior
I expect the editor to continue work without any problem, as I only add a class to tr/td.

Screenshots
Console error.
image
The two buttons.
image

Editor version (please complete the following information):

  • WordPress version: 5.4
  • Does the website has Gutenberg plugin installed, or is it using the block editor that comes by default? "default"
  • If the Gutenberg plugin is installed, which version is it? N/A

Desktop (please complete the following information):

  • OS: Macos 10.14.6
  • Browser Chrome
  • Version 81.0.4044.92

Additional context

@karmatosed
Copy link
Member

karmatosed commented Apr 27, 2020

I can confirm this as a bug. I think being able to edit the HTML in that mode makes sense with adding a class, so let's flag this as a bug, thanks for reporting.

@karmatosed karmatosed added [Type] Bug An existing feature does not function as intended [Block] Table Affects the Table Block labels Apr 27, 2020
@talldan
Copy link
Contributor

talldan commented Feb 4, 2021

This isn't a bug related to the table block, it'll happen with any static block when modifying certain bits of HTML.

If we wanted to solve this just in the context of the table block, we'd need to be able to specify custom class names for table sections, rows, columns, which is pretty much impossible from a UI perspective without a way to select those regions.

Previous similar issues:

I think this is better related to the wider topic of block validation:

As such I'll close this issue in favour of the other discussions.

@talldan talldan closed this as completed Feb 4, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Block] Table Affects the Table Block [Type] Bug An existing feature does not function as intended
Projects
None yet
Development

No branches or pull requests

3 participants