Home › Forums › Bug Reports › Setting default alignment and disabling the toolbar does not work
When setting the default alignment to “wide” and disabling the toolbar, does not reflect the “wide” condition in the editor. It will return to the default.
on the front-end, everything works fine.
Code for setting the alignment and disabling the toolbar for alignment:
'align' => 'full',
'supports' => [
'align' => false,
],
This does not place data-align="full"
on a block, but removes the attribute in total.
Also,
When setting support align to “true” you can toggle between default and full, something that should not be happening if the default is “full” and the only support is “full”
Also noticing this behavior. Seems counter to what it should do (or at least two what I’d expect it to do), which is for the default alignment to honor the value of the specified align property.
When set to full, blocks seem to not be displaying as full. I still have to click the full icon – which means I also have to leave that icon visible.
Ideally I’d be able to set the default alignment to full and also disable the icon bar.
Did anyone fix this issue?
I’ve tried to add custom CSS to the admin panel:
.block-editor-block-list__layout .block-editor-block-list__block[data-align=full],
.block-editor-block-list__layout .block-editor-block-list__block[data-type^="acf/"],
@media (min-width: 600px)
margin-left: -45px
margin-right: -45px
.block-editor-block-list__block-edit
@media (min-width: 600px)
margin-left: -44px
margin-right: -44px
It worked, but Gutenberg still doesn’t understand that this block has a full width, so part of its interface is hidden. It feels too hacky to me. I wish it would work out of the box.
Here is the workaround: https://github.com/AdvancedCustomFields/acf/issues/91
@dominikkucharski:
The initial setting for the size of the block is fine when both ‘align’ and ‘supports[align]’ have been configured. But the align-toolbar still shows, which results in the user being able to toggle between the ‘wanted’ and ‘unwanted’ align setting, although there should be only one option.
The topic ‘Setting default alignment and disabling the toolbar does not work’ is closed to new replies.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.