Button autoFocus
This commit is contained in:
parent
74badced08
commit
6b72eaa762
|
@ -2,6 +2,11 @@
|
|||
const r = require('r-dom');
|
||||
|
||||
const Button = props => r.button({
|
||||
ref: input => {
|
||||
if (input && props.autoFocus) {
|
||||
input.focus();
|
||||
}
|
||||
},
|
||||
className: 'button',
|
||||
...props,
|
||||
}, props.children);
|
||||
|
|
|
@ -35,6 +35,7 @@ const Preferences = withStateHandlers(
|
|||
r.div([
|
||||
r(Button, {
|
||||
style: { width: '100%' },
|
||||
autoFocus: true,
|
||||
onClick: toggle,
|
||||
}, 'Close'),
|
||||
]),
|
||||
|
@ -68,6 +69,7 @@ const Preferences = withStateHandlers(
|
|||
]),
|
||||
] : [
|
||||
r(Button, {
|
||||
autoFocus: true,
|
||||
onClick: toggle,
|
||||
}, 'Cards'),
|
||||
]));
|
||||
|
|
|
@ -34,6 +34,7 @@ const Preferences = withStateHandlers(
|
|||
r.div([
|
||||
r(Button, {
|
||||
style: { width: '100%' },
|
||||
autoFocus: true,
|
||||
onClick: toggle,
|
||||
}, 'Close'),
|
||||
]),
|
||||
|
@ -130,6 +131,7 @@ const Preferences = withStateHandlers(
|
|||
]),
|
||||
] : [
|
||||
r(Button, {
|
||||
autoFocus: true,
|
||||
onClick: toggle,
|
||||
}, 'Preferences'),
|
||||
]));
|
||||
|
|
Loading…
Reference in New Issue
Block a user