aboutsummaryrefslogtreecommitdiff
path: root/src/content/components/common/follow.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/content/components/common/follow.js')
-rw-r--r--src/content/components/common/follow.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/content/components/common/follow.js b/src/content/components/common/follow.js
index 5688da3..65e0af9 100644
--- a/src/content/components/common/follow.js
+++ b/src/content/components/common/follow.js
@@ -1,9 +1,10 @@
import messages from 'shared/messages';
import Hint from './hint';
+import * as dom from 'shared/utils/dom';
const TARGET_SELECTOR = [
'a', 'button', 'input', 'textarea',
- '[contenteditable=true]', '[contenteditable=""]'
+ '[contenteditable=true]', '[contenteditable=""]', '[tabindex]'
].join(',');
const inViewport = (win, element, viewSize, framePosition) => {
@@ -136,8 +137,11 @@ export default class Follow {
case 'button':
return element.click();
default:
- // it may contenteditable
- return element.focus();
+ if (dom.isContentEditable(element)) {
+ return element.focus();
+ } else if (element.hasAttribute('tabindex')) {
+ return element.click();
+ }
}
}