- Issue created by @szeidler
- First commit to issue fork.
- Merge request !210Issue #3483420: Embed content block settings form in editor block → (Open) created by szeidler
- 🇩🇪Germany szeidler Berlin
Wow @marcofernandes. This works pretty good for me and the use-case I described in the issue.
Really nice work and in my opinion works much smoother than editing block content in the sidebar.
- Status changed to Needs review
about 1 month ago 1:51pm 6 February 2025 - 🇳🇴Norway vegardjo
Thanks for this, guys, came at a very convenient time :)
I've applied this as a patch, and will test it the coming days.
One remark on the UX here, that I experienced both with the initial sidebar editing and the inline editing (even when being fully aware of it), is that you need to click "update block" before you click "save" on the content form. If you edit the block, and just click save, you will immediately lose the content you have added to the block.
Even as this makes full sense, people will click save without updating the block, which will lead to frustrations.
I can see some ways of mitigating it:
- actually using the modal, even though I also like the inline more, as this prevents you to do this mistake, and also conceptually clarifies better that this is not a normal Gutenberg block.
- disable the save button if you have changes in the block.
- give a warning if same as above, similar to when you navigate away without saving.
Seems to me the most straight forward way to do this is to revert to the modal solution, which I guess would also remove the possible styling issue with the inline method.
- 🇩🇪Germany szeidler Berlin
There is of course the decision to do if modal or not.
One possibility without a modal would be to put Gutenberg into a "non clean state" when having the block expanded. Then the "Save" node button actually would trigger a warning and prevent saving.
- 🇳🇴Norway vegardjo
For sure, no objections on that, as long as we can handle the issue one way or the other.
- 🇳🇴Norway vegardjo
Just realized that simply clicking outside the block without clicking the update block will also make you lose content.
- 🇩🇪Germany szeidler Berlin
Oh wow, I haven't noticed this one so far.
That's for sure a big UX problem and prone to lose content changes.
- 🇺🇸United States loze Los Angeles
Its worth mentioning that the issue described in #8 happens w/o this patch as well. If the block is in the sidebar.
There should be some way to block clicking on another item, or to autosave the the block if they do.
- 🇳🇴Norway vegardjo
Thanks for pointing that out, loze!
Rounding back to modal, I guess using that approach will mitigate both, as the modal needs to either be x-ed out in the top right, ESC-ed out with keyboard, or saved. It will not close if you click outside, and you are not allowed to save the node unless the modal is closed.
The visible editing area is also approximately the same, so I'd say the UX is very similar, even though one might prefer one over the other.
- 🇺🇸United States loze Los Angeles
Yea, I think a modal is a better approach.
- 🇳🇴Norway vegardjo
vegardjo → changed the visibility of the branch 3.0.x to hidden.
- 🇳🇴Norway vegardjo
vegardjo → changed the visibility of the branch 3.0.x to active.
- 🇮🇳India piyusha_pokharana
I have altered code in Gutenberg module to show sidebar config in modal popup, but post this changes there were some issues when we have other modal popup on same page like media browser in ckeditor, Media upload option, any other config which gets open in modal.
The #drupal-modal is actually getting replaced with new config form. Considering this is necessary when implementing the modal approach for sidebar configuration. - 🇺🇸United States loze Los Angeles
@piyusha That is a core bug thats being worked on here 🐛 Nested modals don't work: opening a modal from a modal closes the original Needs work It's not specific to gutenberg