-
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
Update/1038 freeform block add more drawer #1153
Update/1038 freeform block add more drawer #1153
Conversation
break; | ||
} | ||
blockControls = blockControls.parentElement; | ||
} |
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.
What element are we trying to get here? Could we use element.closest()
instead of looping like this (We just need to include the polyfill import 'element-closest';
?
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 considered element.closest() but dismissed it because IE does not support it. I didn't know that the polyfill was available.
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 have updated to use the polyfill.
<Toolbar controls={ this.mapControls( MORE_CONTROLS ) } /> | ||
</div> | ||
), | ||
} ) } |
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.
Should we consolidate the two <BlockControls>
usage and the <Fill name="Formatting.Toolbar">
into a unique <BlockControls>
?
Something like
<BlockControls>
<Toolbar />
<Toolbar />
<Toolbar />
</BlockControls>
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.
That would make things much cleaner. It should probably be done as a separate pull request though.
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.
Nevermind, I see how it can be done now - I had assumed that the controls prop were the only way to set the content of the element.
Previously I was using multiple calls to BlockControls using the controls prop.
Added a rule to allow the toolbar css to apply to inline toolbars Added a rule to fix colour of button text (ie subscript) when hovered
This pull request adds the ability of toolbar items to have children (which allows menus) and it uses this to implement a basic more-drawer (aka kitchen sink, aka ellipse menu) for the freeform block.
Still to do:
Add arrow pointing to ellipse button as in mockup (Freeform Block: Add "Kitchen Sink" #1038 )Fix scrolling behaviour so it does not go offscreen