-
Notifications
You must be signed in to change notification settings - Fork 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
Editor: Reset title scroll position on blur #546
Conversation
Confirming the bug and the fix. 👍 |
@@ -66,6 +66,8 @@ export default React.createClass( { | |||
} ); | |||
|
|||
this.onChange( event ); | |||
|
|||
event.target.scrollLeft = 0; |
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.
Is this something that should really be part of FormTextInput
? Feels brittle to be monkeying with a DOM element from a custom element, as you don't really know what event.target
is, or if it's the scrollable element.
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.
Is this something that should really be part of
FormTextInput
? Feels brittle to be monkeying with a DOM element from a custom element.
That would depend whether we think browser quirks fall under the scope of behaviors to be implemented in the base form components. I'd personally lean towards keeping them as "pure" as possible such that their purpose is primarily aimed at keeping form styling consistent across the app. That said, an alternative view would be to consider them as normalized components, in which this would help keep behavior consistent across browsers.
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.
Right. Either way, shouldn't hold the merge.
…title-scroll Editor: Reset title scroll position on blur
Fixes #347
This pull request seeks to resolve an issue in Firefox where, after tabbing from the editor title field after having entered a very long title, the field would not reset to the start of the field.
Before:
After:
Testing instructions:
Verify that the title resets to the show the beginning of the field value when tabbing to the editor. This should behave correctly in Firefox and in your preferred browser.