-
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
Refactor more block #23758
Refactor more block #23758
Conversation
Size Change: -90 B (0%) Total Size: 1.14 MB
ℹ️ View Unchanged
|
There were some unit tests that need updating. I have pushed a commit updating them. |
Wow @ZebulanStanphill , that was fast :) ! Thanks!! I left it in draft, as I am out for today in a minute and wanted to make an issue first, that this PR fixes too ( about empty saved value ). |
}; | ||
} | ||
export default function MoreEdit( { | ||
// we provide a default value as previously we allowed to save `undefined`, even though it wasn't clear to the UI |
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.
This comment isn't really clear to me. Also, most comments should use sentence capitalization and punctuation.
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.
Also, most comments should use sentence capitalization and punctuation.
I'll keep it in mind. Thanks! -- I changed the comment.
Hm, this is a tricky situation. The thing is that this fix is a breaking change for WP's old I would also point out that, in general, we should be sceptical anytime we see "attributes": {
"attrName": {
"type": "string",
"default": "xyz"
}, The More block is a little exceptional because I'll comment on #23780. Meanwhile, I think this PR should just be about the refactoring. :) |
Thanks @mcsf for the elaborate explanation. I believe we should let the user have an empty text but not show anything default for this PR. If I understand correctly you believe so too, right? |
Unit test failure is legitimate; the behavior is still different from |
It looks like the only remaining test failure is an intermittent/unrelated one. Try rebasing the branch to get the tests to run again. |
74f1542
to
8cde812
Compare
Alright, I've created #23836 to fix the handling of the More block default text placeholder. |
Description
This PR refactors
More
block to a function component.Related #22890
Checklist: