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

Fixes removal of unstableOnFocus prop #20484

Merged
Show file tree
Hide file tree
Changes from all commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,6 @@ export default class Question extends Component {
answer,
} = attributes;


return (
<div className="schema-faq-section" key={ id }>
<RichText
Expand All @@ -342,6 +341,8 @@ export default class Question extends Component {
key={ id + "-question" }
value={ question }
onChange={ this.onChangeQuestion }
onFocus={ this.onFocusQuestion }
// The unstableOnFocus prop is added for backwards compatibility with Gutenberg versions <= 15.1 (WordPress 6.2).
unstableOnFocus={ this.onFocusQuestion }
placeholder={ __( "Enter a question", "wordpress-seo" ) }
allowedFormats={ [ "core/italic", "core/strikethrough", "core/link", "core/annotation" ] }
Expand All @@ -353,6 +354,8 @@ export default class Question extends Component {
key={ id + "-answer" }
value={ answer }
onChange={ this.onChangeAnswer }
onFocus={ this.onFocusAnswer }
// The unstableOnFocus prop is added for backwards compatibility with Gutenberg versions <= 15.1 (WordPress 6.2).
unstableOnFocus={ this.onFocusAnswer }
placeholder={ __( "Enter the answer to the question", "wordpress-seo" ) }
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -734,8 +734,10 @@ export default class HowTo extends Component {
tagName="p"
className="schema-how-to-description"
value={ attributes.description }
unstableOnFocus={ this.focusDescription }
onChange={ this.onChangeDescription }
onFocus={ this.focusDescription }
// The unstableOnFocus prop is added for backwards compatibility with Gutenberg versions <= 15.1 (WordPress 6.2).
unstableOnFocus={ this.focusDescription }
placeholder={ __( "Enter a description", "wordpress-seo" ) }
/>
<ul className={ listClassNames }>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -314,6 +314,7 @@ export default class HowToStep extends Component {
} = this.props;

const { id, name, text } = step;

return (
<li className="schema-how-to-step" key={ id }>
<span className="schema-how-to-step-number">
Expand All @@ -329,8 +330,10 @@ export default class HowToStep extends Component {
key={ `${ id }-name` }
value={ name }
onChange={ this.onChangeTitle }
placeholder={ __( "Enter a step title", "wordpress-seo" ) }
onFocus={ this.onFocusTitle }
// The unstableOnFocus prop is added for backwards compatibility with Gutenberg versions <= 15.1 (WordPress 6.2).
unstableOnFocus={ this.onFocusTitle }
placeholder={ __( "Enter a step title", "wordpress-seo" ) }
allowedFormats={ [ "core/italic", "core/strikethrough", "core/link", "core/annotation" ] }
/>
<RichTextWithAppendedSpace
Expand All @@ -340,8 +343,10 @@ export default class HowToStep extends Component {
key={ `${ id }-text` }
value={ text }
onChange={ this.onChangeText }
placeholder={ __( "Enter a step description", "wordpress-seo" ) }
onFocus={ this.onFocusText }
// The unstableOnFocus prop is added for backwards compatibility with Gutenberg versions <= 15.1 (WordPress 6.2).
unstableOnFocus={ this.onFocusText }
placeholder={ __( "Enter a step description", "wordpress-seo" ) }
/>
{ isSelected &&
<div className="schema-how-to-step-controls-container">
Expand Down