Conversation
gziolo
left a comment
There was a problem hiding this comment.
because I was working on thxis as you did some "is-selected" work, that I may have messed up in a rebase.
All good with isSelected :)
I left a few other comments to consider.
| { | ||
| 'has-fixed-layout': hasFixedLayout, | ||
| }, | ||
| align ? `align${ align }` : null, |
There was a problem hiding this comment.
align ? align${ align } : null, can be moved to the object as follows:
{
'has-fixed-layout': hasFixedLayout,
[ `align${ align }` ]: align,
},| } | ||
|
|
||
| // Style the resize handles | ||
| .ephox-snooker-resizer-rows { |
There was a problem hiding this comment.
Those names look alien, is there any way to make them look as WordPress internals? :)
There was a problem hiding this comment.
I'm afraid those are from deep within the core of the TinyMCE library, so we can't change them unless we change those core files.
There was a problem hiding this comment.
Sounds okey, I had to double check :)
| PanelBody, | ||
| ToggleControl, | ||
| } from '@wordpress/components'; | ||
| import classnames from 'classnames'; |
There was a problem hiding this comment.
classnames is an external dependency.
| <tbody key="1"> | ||
| <tr><td><br /></td><td><br /></td></tr> | ||
| <tr><td><br /></td><td><br /></td></tr> | ||
| <tr><td><br /></td><td><br /></td><td><br /></td></tr> |
There was a problem hiding this comment.
Is it for testing or do we plan to change the default table layout to to 3x2?
| /> | ||
| </BlockControls> | ||
| <InspectorControls> | ||
| <PanelBody title={ __( 'Table Settings' ) } className="blocks-table-settings"> |
There was a problem hiding this comment.
According to the coding styles we follow this className should be blocks-table__settings, right?
|
Rebased. |
fc05085 to
6aa1ad5
Compare
|
Rebased and squashed. I think this is ready for final review. |
|
I'd agree Gutenberg shouldn't try to make the table responsive, that's not its responsibility. More importantly, altering the CSS |
|
Yep, that was one of the reasons I threw in the towel on any responsiveness other than horizontal scrolling. I think there could be a place for a "Responsive Table" block, that's built from the start to let you insert tabular data in a transforming way. But alas, it's not this block. |
|
Nice. For that future block, take into consideration @aardrian has experimented a lot with responsive, accessible, tables ;) |
Definitely — though I think that's likely going to be plugin territory for the near future/v1. |
|
It's not always working properly with all those dimension styles applied: I pushed a commit which fixes the failing fixture test: 77bf6ce. It looks like it also needs to be rebased. Doing it now. |
|
Going to rebase when we decide on #6739 (comment) |
This branch is based off of `try/better-responsive-table`, but without my attempt at better responsiveness. - New toggle to decide whether table has fixed widths, off by default, as discussed in #2620 - Surface and style the resizing tool
|
Rebased. I think this is ready for final approval. What do you think, @gziolo ? |
|
|
||
| .ephox-snooker-resizer-bar-dragging { | ||
| background: $blue-medium-500; | ||
| } No newline at end of file |
There was a problem hiding this comment.
Missing an empty line here :)
|
|
||
| save( { attributes } ) { | ||
| const { content, align } = attributes; | ||
| save( { attributes, className } ) { |
There was a problem hiding this comment.
There's no className prop passed to the save callback we should just remove it, it will be added automatically.
|
Looks good to me, left some small comments, Let's merge once resolved. |
|
Thanks, @youknowriad for the review. I addressed it. However, I'm seeing an issue with saving and publishing. I don't know if I messed somethign up in the rebase, but the table isn't being saved, looks like :( any idea what's up? Try to create a table in this branch, save, preview, or save and publish. It's not working |
|
Yaay thank you! |
| } | ||
|
|
||
| // Style the resize handles | ||
| .ephox-snooker-resizer-rows { |
There was a problem hiding this comment.
Should these styles be applied only within the context of the table block? As implemented, these will impact any table on the screen, regardless of within the block. Even if they're desirable globally, I don't think the styles should be implemented here (since a block's styles shouldn't be impacting the page as a whole).
There was a problem hiding this comment.
I wish I could scope these to be table block specific only. However these elements are inserted into the root of the DOM.
I can move them to the main stylesheet if you like?

This branch is based off of
try/better-responsive-table, but without my attempt at better responsiveness.In that other branch I tried desperately to build in a responsive table feature, but it just doesn't seem possible to do in a good way that works for every WordPress theme out there. Stacking is fine, but if we can't stack as columns, you'll just end up with a mishmash of out of context rows. If we truly want a responsive table, we have to write a new one in Flexbox from the start :(
CC: @gziolo because I was working on thxis as you did some "is-selected" work, that I may have messed up in a rebase.
GIF: