-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
RichText: restore focus after setting selection #17617
Changes from all commits
f69af55
1ab4854
483735b
92ed806
7a1b814
f31d816
fc138bf
032d0dd
9de7520
8468062
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -149,9 +149,9 @@ class InlineLinkUI extends Component { | |
|
||
if ( isCollapsed( value ) && ! isActive ) { | ||
const toInsert = applyFormat( create( { text: url } ), format, 0, url.length ); | ||
onChange( insert( value, toInsert ) ); | ||
onChange( insert( value, toInsert ), { focus: true } ); | ||
} else { | ||
onChange( applyFormat( value, format ) ); | ||
onChange( applyFormat( value, format ), { focus: true } ); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This API is interesting is it possible to call onChange without any change? So for example in the color picker when the popovers close and we know that we will not apply additional color changes we would call onChange to move the focus back to the rich text as the inline link does. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this is just what I was looking for, it works well. Thanks a lot for all your hard work @ellatrix @jorgefilipecosta |
||
} | ||
|
||
this.resetState(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These tests were not in alphabetic order... Jest reordered them.