Skip to content
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

Bug: 355: Collapsible Block - generate unique id's when blocks are duplicated #356

Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix bug where you can’t enter a space into the button since button el…
…ements use space key for execution
acketon committed Jun 7, 2024

Unverified

This user has not yet uploaded their public signing key.
commit 84a763f10bc0691191567bf2c6361c97f88c3ff8
22 changes: 12 additions & 10 deletions src/blocks/collapsible-control/collapsible-control.js
Original file line number Diff line number Diff line change
@@ -63,16 +63,18 @@ registerBlockType( 'bu/collapsible-control', {

<Fragment>
<p {...blockProps}>
<RichText
tagName="button"
className={togglebuttonclasses}
placeholder={ __( 'Toggle Text' ) }
value={ text }
onChange={ ( value ) => setAttributes( { text: value } ) }
formattingControls={ [ 'bold', 'italic' ] }
withoutInteractiveFormatting
keepPlaceholderOnFocus
/>
<button>
<RichText
tagName="span"
className={togglebuttonclasses}
placeholder={ __( 'Toggle Text' ) }
value={ text }
onChange={ ( value ) => setAttributes( { text: value } ) }
formattingControls={ [ 'bold', 'italic' ] }
withoutInteractiveFormatting
keepPlaceholderOnFocus
/>
</button>
</p>
<InspectorControls>
<PanelBody title={ __( 'Control Options' ) }>