17 lines
331 B
JavaScript
17 lines
331 B
JavaScript
|
|
||
|
import isMobile from './is-mobile';
|
||
|
|
||
|
export default function focus(element) {
|
||
|
if (isMobile) return;
|
||
|
setTimeout(() => element.focus(), 10);
|
||
|
}
|
||
|
|
||
|
export function select(element) {
|
||
|
if (isMobile) return;
|
||
|
setTimeout(() => {
|
||
|
element.focus();
|
||
|
if (element.select)
|
||
|
element.select();
|
||
|
}, 10);
|
||
|
}
|