stremio-web/src/common/useTabIndex.js
NikolaBorislavovHristov 5d9ae88c8d new line removed
2019-08-19 09:49:24 +03:00

11 lines
293 B
JavaScript

const { useFocusable } = require('stremio-router');
const useTabIndex = (tabIndex, disabled) => {
const focusable = useFocusable();
return (tabIndex === null || isNaN(tabIndex)) ?
(focusable && !disabled ? 0 : -1)
:
tabIndex;
};
module.exports = useTabIndex;