Skip to content

Commit

Permalink
Fix for the fact that sometimes too much accordion items were added (#…
Browse files Browse the repository at this point in the history
…1851)

* Fix for the fact that sometimes too much accordion items were added

* add contributor

Co-authored-by: AnthonyLedesma <anthonymledesma@gmail.com>
  • Loading branch information
olafleur and AnthonyLedesma committed Mar 15, 2021
1 parent a31d1d5 commit ca55120
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,4 @@ This list is manually curated to include valuable contributions by volunteers th
| @WunderBart | |
| @sirreal | @jonsurrell |
| @kishanjasani | @kishanjasani |
| @olafleur | |
2 changes: 1 addition & 1 deletion src/blocks/accordion/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ class AccordionEdit extends Component {
<Button
label={ __( 'Add accordion item', 'coblocks' ) }
className="block-editor-button-block-appender"
onMouseUp={ handleEvent }
onMouseDown={ handleEvent }
>
<Icon icon={ plus } />
</Button>
Expand Down
3 changes: 1 addition & 2 deletions src/blocks/accordion/test/accordion.cypress.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,7 @@ describe( 'Block: Accordion', () => {
it( 'can add multiple accordion item blocks', () => {
cy.get( '[data-type="coblocks/accordion"]' ).click( 'top', { force: true } );

cy.get( '.coblocks-block-appender button' ).trigger( 'mouseup' );
// Using trigger here instead of click to more accurately represent behavior of event bubbling from user interaction within the editor.
cy.get( '.coblocks-block-appender button' ).click();

cy.get( '[data-type="coblocks/accordion"]' ).find( '[data-type="coblocks/accordion-item"]' ).should( 'have.length', 2 );

Expand Down

0 comments on commit ca55120

Please sign in to comment.