-
Notifications
You must be signed in to change notification settings - Fork 4.6k
DataForm: Fix panel field inaccessible when empty with labelPosition none #73764
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
base: trunk
Are you sure you want to change the base?
DataForm: Fix panel field inaccessible when empty with labelPosition none #73764
Conversation
…lds when label position is none.
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message. To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
|
cc: @oandregal, @jameskoster |
| 'aria-expanded'?: boolean; | ||
| } ) { | ||
| const isEmpty = | ||
| labelPosition === 'none' && |
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'm still familiarizing myself with DF, but I think:
- the same problem occurs even with a label
- the same problem occurs at least in
cardlayout
When empty should we use for summaryContent an edit: ${attribute label} instead of empty field? I think that's better, but if we went for an empty field approach, it should be different based on the number of fields.
Finally with this change in the story ?path=/story/dataviews-dataform--layout-panel&args=labelPosition:none the discussion appears empty. Is this in indicator that we need a getValue there in general?
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.
edit: ${attribute label}
I had a similar thought 👍
Edit: I realised this is a bit related to #73036. "${attribute label} unset" could also be an option for when the label is hidden. When the label is visible we might not need to repeat it.
This PR Adds a fallback placeholder for empty panel fields when
labelPositionis set tonone.Why?
When a DataForm panel field has
labelPosition: noneand the field value is empty, the summary button renders with no content, collapsing to zero width. This makes the field inaccessible since there's nothing to click to open the panel. There is no way a use can open the field panel and make the field not empty.How?
Display "(Empty field)" text when
labelPosition === 'none'and all summary field values are empty.Testing
labelPosition: nonehttp://localhost:50240/?path=/story/dataviews-dataform--layout-panel&args=labelPosition:none