-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
feat(Input): add focus() method #1477
Conversation
@@ -129,7 +129,7 @@ class ComponentExample extends Component { | |||
} | |||
|
|||
copyJSX = () => { | |||
copyToClipboard(this.getOriginalSourceCode()) | |||
copyToClipboard(this.state.sourceCode) |
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.
Bug fix, an example's copy button was copying the original source code. This update makes it copy the current state of the editor.
38de9e9
to
95c0a7e
Compare
Codecov Report
@@ Coverage Diff @@
## master #1477 +/- ##
==========================================
+ Coverage 99.74% 99.74% +<.01%
==========================================
Files 141 141
Lines 2368 2371 +3
==========================================
+ Hits 2362 2365 +3
Misses 6 6
Continue to review full report at Codecov.
|
@@ -34,10 +34,10 @@ ButtonOr.propTypes = { | |||
className: PropTypes.string, | |||
|
|||
/** Or buttons can have their text localized, or adjusted by using the text prop. */ | |||
text: PropTypes.oneOfType( | |||
text: PropTypes.oneOfType([ |
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.
Fixed a bad propType argument.
95c0a7e
to
6efe8a3
Compare
Released in |
Fixes #1475
A
ref
on a composite component (like the Input) will return a reference to the class instance. This PR adds a focus method to the Input that focuses the HTML input. This allows users to callfocus()
on the Input ref and it will focus the internal HTML input element.An example and test was also added.