-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Block Editor: LinkControl: Add Submit button as action #19971
Conversation
I couldn't have said it better myself. The only thing that comes to mind is that a visual submit button might be more obvious and accessible than using the I will say, having two actions within the input is probably too much. If we decide to add a submit button, then perhaps we should remove the reset button to keep the number of actions to one. |
Yeah, personally, I would prefer that anything which behaves like a form (takes a submission) would have some explicit Submit button somewhere. I also recognize that it's somewhat at odds with the otherwise minimalistic aesthetic of the field.
I mentioned in passing in the original comment, but #19570 could be very much relevant to this conversation. That is, f we decide that the "Reset" button should be removed, could it be reasonable then to keep the "Submit" button (i.e. swap out Reset for Submit). |
The issue I opened at #20007 has relevance, since it explores what might be necessary to reintroduce a "Link Settings" button/toggle to the editing state of this component. That would be a third option, in addition to the existing "Submit" and "Reset" considerations. What I propose there is to remove "Reset" altogether, and go with "Submit" and "Settings". That's still two actions, but it is consistent with how this UI has existed up 'til now (the previous Gutenberg link UI and the link UI in the Classic Editor). At the very least, to keep this moving, I might still like to implement replacing "Reset" with just "Submit", but including all of the CSS refactoring which should make it simpler to adjust these buttons in the future (adding, removing, or substituting). |
Allow for reuse in computing dimensions in other stylesheets
Instead inherit that the form cannot be submitted since the rendered URLInput will apply a `required` attribute, preventing submission of the form, while still displaying the associated help text "You must fill out this field"
67b86c9
to
62ff4a5
Compare
I've rebased the branch to resolve conflicts, and per my previous comment, to change the purpose of the pull request to replace the "Reset" button with the Submit button. I've also altered the implementation slightly to further consolidate the dimensions calculations as based on the number of actions present (anticipating that this could potentially change in the future). |
I agree with adding a button to allow submission. I think "RESET" is probably an edge case and not a primary action. Therefore, if we need to remove one to save space and reduce UI clutter (and potential choice paralysis) then I vote to remove Reset. |
Noting that this was cherry-picked to be absorbed into the efforts at #20052, though this one could still be landed separately as more targeted to the specific change. |
Closing, since #20052 included the changes proposed here. |
Extracted from #19462
Related: #19570
This pull request seeks to add a new "Submit" button to be shown
alongsideinstead of the existing "Reset" button in the newLinkControl
component used by the Navigation and Buttons blocks.Original Before/After
Rationale
It only really occurs to me now, but I'm not really sure what benefits this brings.
If I had to guess:
Even if we decide not to move forward with adding a submit button, and depending on some decision out of #19570 as to whether the "Reset" button should be removed as well, the proposed changes could still be valuable in providing a more reliable computation of offsets for absolute positioning of the spinner and reset buttons.
Testing Instructions:
Verify that when editing a link in a Navigation or Buttons block, you should see a Submit button shown an activated as long as the input contains a valid link.
Check as well that issues raised in #19462 with the original implementation have been addressed: