|
|
@ -4,7 +4,7 @@ import * as dom from 'shared/utils/dom'; |
|
|
|
|
|
|
|
|
|
|
|
const TARGET_SELECTOR = [ |
|
|
|
const TARGET_SELECTOR = [ |
|
|
|
'a', 'button', 'input', 'textarea', |
|
|
|
'a', 'button', 'input', 'textarea', |
|
|
|
'[contenteditable=true]', '[contenteditable=""]' |
|
|
|
'[contenteditable=true]', '[contenteditable=""]', '[tabindex]' |
|
|
|
].join(','); |
|
|
|
].join(','); |
|
|
|
|
|
|
|
|
|
|
|
const inViewport = (win, element, viewSize, framePosition) => { |
|
|
|
const inViewport = (win, element, viewSize, framePosition) => { |
|
|
@ -139,6 +139,8 @@ export default class Follow { |
|
|
|
default: |
|
|
|
default: |
|
|
|
if (dom.isContentEditable(element)) { |
|
|
|
if (dom.isContentEditable(element)) { |
|
|
|
return element.focus(); |
|
|
|
return element.focus(); |
|
|
|
|
|
|
|
} else if (element.hasAttribute('tabindex')) { |
|
|
|
|
|
|
|
return element.click(); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|