-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Table block: Fix focus loss in between row/column insertions. #23508
Conversation
6284ece
to
71be636
Compare
Size Change: +2.02 kB (0%) Total Size: 1.13 MB
ℹ️ View Unchanged
|
This just allows to be able to add more rows, by enabling the corresponding buttons. It needs to be revised when programmatically focus to RichText is handled.
71be636
to
22daaf8
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think some clear testing instructions for this pull request would be very helpful, since the issue isn't obvious to reproduce consistently.
I'm glad you link to #9740, I think that's useful context to have. That said, my first impression is that we can best address the current Table issue by finding what — if anything — we can do at the DOM-event level to mitigate the issue.
// this just allows to be able to add more rows, by enabling the corresponding | ||
// buttons. It needs to be revised when programmatically focus to RichText is handled | ||
this.createOnFocus( { | ||
sectionName, | ||
rowIndex: newRowIndex, | ||
columnIndex: 0, | ||
} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By definition, createOnFocus
just returns a new function but doesn't do anything with it. So I'm fairly sure that nothing is happening here. :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks Miguel. I saw the code now and couldn't understand why I left it that way... Maybe when I was trying to find how to focus on RichText..?
I changed it to just change the selected cell in state.
// this just allows to be able to add more rows, by enabling the corresponding | ||
// buttons. It needs to be revised when programmatically focus to RichText is handled | ||
this.createOnFocus( { | ||
rowIndex: 0, | ||
columnIndex: newColumnIndex, | ||
} ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same observation as for rows.
Co-authored-by: Miguel Fonseca <[email protected]>
Co-authored-by: Miguel Fonseca <[email protected]>
Nice fix! |
Thank you. I'll be so glad when I can add rows easier. I have a few situations where I need to go to an existing table and add 20-30 at a time. This will cut down on clicks. |
* Enable add row/column buttons after having added one. This just allows to be able to add more rows, by enabling the corresponding buttons. It needs to be revised when programmatically focus to RichText is handled. * set selected cell in state * Change comment description Co-authored-by: Miguel Fonseca <[email protected]> * Change comment description Co-authored-by: Miguel Fonseca <[email protected]> Co-authored-by: Miguel Fonseca <[email protected]>
Description
Fixes #23103
This PR just allows to be able to add more rows/columns, by enabling the corresponding buttons, after having added a row/column.
To reproduce what happens now:
Table
block ( ex 2x2 ) and insert some text in a cellToolbar
and clickAdd a row Before/After
Toolbar
again and in the Dropdown menu for adding rows you'll see that everything is disabledOther enhancements on
Table
block can be handled separately, such as adding keyboard support for some actions.It needs to be revised when programmatically focus to RichText is handled, as mentioned here #9740.
How has this been tested?
Screenshots
Types of changes
Checklist: