WordPress / gutenberg

The Block Editor project for WordPress and beyond. Plugin is available from the official repository.
https://wordpress.org/gutenberg/
Other
10.47k stars 4.18k forks source link

Set up the limit for the max number of column field & max number of row field can be added to table block of gutenberg #44808

Open 1995kruti opened 2 years ago

1995kruti commented 2 years ago

Description

During QA of beta version I found below issue, can you please have a look if possible

Right now there is no maximum number limit set up for the table block of Gutenberg.

User can add any number of rows & columns to the table block which is breaking the backend of WordPress.

I believe, nobody will add that kind of inputs there but we can add those validations for better usability.

I have checked above issue over the WordPress Version 6.0.2, Version 6.1 (Beta 3)

Step-by-step reproduction instructions

  1. Go to WordPress Guttenberg editor for any existing page
  2. Add an element for the Table
  3. You will find an option to add Column Count & Row Count
  4. If you add more than 100 number for any of "Column count / Row count" , it will accept it and break the backend page

Screenshots, screen recording, code snippet

Screenshot 2022-10-10 112848

Environment info

No response

Please confirm that you have searched existing issues in the repo.

Yes

Please confirm that you have tested with all plugins deactivated except Gutenberg.

Yes

t-hamano commented 1 year ago

Thank you for your contribution.

I too think limiting the max number is a good idea. I have confirmed that if I try to create a table with huge row/column numbers, the block editor freezes and causes a out-of-memory error.