Skip to content

Commit

Permalink
Fix scroll with VoiceOver ON.
Browse files Browse the repository at this point in the history
For some reason, VoiceOver wouldn't scroll down the block list.
The breaking change was located at the removal of this css property `font-family: $default-regular-font;` on the nextpage block.

Addinb back that property to be able to scroll the blocks list again using VoiceOver.
  • Loading branch information
etoledom committed Apr 22, 2019
1 parent 3f3428d commit 14652d6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
{
}
24 changes: 12 additions & 12 deletions packages/block-library/src/nextpage/edit.native.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ import { __ } from '@wordpress/i18n';
*/
import styles from './editor.scss';

export default function NextPageEdit( { attributes } ) {
const { customText = __( 'Page break' ) } = attributes;
// Setting the font here to keep the CSS linter happy, it was demanding a syntax
// that React Native wasn't able to handle (adding a fallback generic font family).
const textStyle = {
...styles[ 'block-library-nextpage__text' ],
fontFamily: 'System',
};
export default function NextPageEdit( { attributes, isSelected, onFocus } ) {
const { customText = __('Page break') } = attributes;
const accessibilityTitle = attributes.customText || '';

return (
<View style={ styles[ 'block-library-nextpage__container' ] }>
<Hr text={ customText }
textStyle={ textStyle }
lineStyle={ styles[ 'block-library-nextpage__line' ] } />
<View
accessible
accessibilityLabel={__('Page break block') + '. ' + accessibilityTitle}
accessibilityStates={isSelected && ['selected']}
onAccessibilityTap={onFocus}
>
<Hr text={customText}
textStyle={styles['block-library-nextpage__text']}
lineStyle={styles['block-library-nextpage__line']} />
</View>
);
}
1 change: 1 addition & 0 deletions packages/block-library/src/nextpage/editor.native.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

.block-library-nextpage__text {
color: $gray;
font-family: $default-regular-font;
text-decoration-style: solid;
text-transform: uppercase;
}

0 comments on commit 14652d6

Please sign in to comment.