select value on focus
Summary: select the value of any input element once the field gets focus. Reviewed By: emilsjolander Differential Revision: D7009723 fbshipit-source-id: e1bc0f4b219958d8bdb79ef1a583cad86157b050
This commit is contained in:
committed by
Facebook Github Bot
parent
269619a419
commit
c5371aca64
@@ -36,6 +36,7 @@ export default (props: Props<*>) => {
|
||||
{...props}
|
||||
onChange={e => props.onChange(props.property, e.target.value)}
|
||||
placeholder="undefined"
|
||||
onFocus={e => e.target.select()}
|
||||
value={Number.isNaN(props.value) ? '' : props.value}
|
||||
/>
|
||||
);
|
||||
|
Reference in New Issue
Block a user