Skip to content

Commit

Permalink
release: version 2.6.2
Browse files Browse the repository at this point in the history
### Bug Fixes
- **Fixes form submit button issue**: Fixes an issue when the form submit button accepts line-breaks in the editor.
- **Fixes animation trigger for large elements**: Fixes an issue where animation does not trigger for large elements on the screen.
  • Loading branch information
HardeepAsrani authored Dec 26, 2023
2 parents 9a5b268 + 79b737d commit 2774d71
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/animation/frontend.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,9 @@ const isElementInViewport = ( el ) => {
};

return (
( bounds.bottom >= viewport.top && bounds.bottom <= viewport.bottom ) ||
( bounds.top <= viewport.bottom && bounds.top >= viewport.top )
( bounds.bottom >= viewport.top && bounds.top <= viewport.bottom ) || // Element spans the viewport
( bounds.top <= viewport.bottom && bounds.bottom >= viewport.bottom ) || // Top part of the element is in the viewport
( bounds.bottom >= viewport.top && bounds.top <= viewport.top ) // Bottom part of the element is in the viewport
);
};

Expand Down
7 changes: 6 additions & 1 deletion src/blocks/blocks/form/edit.js
Original file line number Diff line number Diff line change
Expand Up @@ -1040,7 +1040,12 @@ const Edit = ({
className='wp-block-button__link'
placeholder={ __( 'Submit', 'otter-blocks' ) }
value={ attributes.submitLabel }
onChange={ submitLabel => setAttributes({ submitLabel }) }
onChange={ submitLabel => {
submitLabel = submitLabel.replace( /<br\s*\/?>/gi, ' ' );
setAttributes({ submitLabel });
} }
multiline={ false }
multiple={ false }
tagName="button"
type='submit'
onClick={ e => e.preventDefault() }
Expand Down
1 change: 1 addition & 0 deletions src/onboarding/store.js
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ const actions = {

if ( ! selectedTemplate ) {
dispatch( actions.nextStep() );
recordEvent( event );
return;
}

Expand Down

0 comments on commit 2774d71

Please sign in to comment.