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

Editor: Reset title scroll position on blur #546

Merged
merged 1 commit into from
Nov 24, 2015
Merged
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
2 changes: 2 additions & 0 deletions client/post-editor/editor-title/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ export default React.createClass( {
} );

this.onChange( event );

event.target.scrollLeft = 0;
Copy link
Contributor

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.

Copy link
Contributor Author

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.

Copy link
Contributor

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.

},

onFocus() {
Expand Down