fix: use focusin/focusout instead of custom events (#1308)
This commit is contained in:
parent
38241abf35
commit
19566bda2e
|
@ -1,8 +1,8 @@
|
||||||
<h1 class="sr-only">{label}</h1>
|
<h1 class="sr-only">{label}</h1>
|
||||||
<div class="timeline"
|
<div class="timeline"
|
||||||
role="feed"
|
role="feed"
|
||||||
on:focusWithCapture="saveFocus(event)"
|
on:focusin="saveFocus(event)"
|
||||||
on:blurWithCapture="clearFocus(event)"
|
on:focusout="clearFocus()"
|
||||||
>
|
>
|
||||||
{#await componentsPromise}
|
{#await componentsPromise}
|
||||||
<!-- awaiting promise -->
|
<!-- awaiting promise -->
|
||||||
|
@ -51,7 +51,6 @@
|
||||||
showMoreItemsForThread,
|
showMoreItemsForThread,
|
||||||
showMoreItemsForCurrentTimeline
|
showMoreItemsForCurrentTimeline
|
||||||
} from '../../_actions/timeline'
|
} from '../../_actions/timeline'
|
||||||
import { focusWithCapture, blurWithCapture } from '../../_utils/events'
|
|
||||||
import { scheduleIdleTask } from '../../_utils/scheduleIdleTask'
|
import { scheduleIdleTask } from '../../_utils/scheduleIdleTask'
|
||||||
import { mark, stop } from '../../_utils/marks'
|
import { mark, stop } from '../../_utils/marks'
|
||||||
import isEqual from 'lodash-es/isEqual'
|
import isEqual from 'lodash-es/isEqual'
|
||||||
|
@ -141,10 +140,6 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
store: () => store,
|
store: () => store,
|
||||||
events: {
|
|
||||||
focusWithCapture,
|
|
||||||
blurWithCapture
|
|
||||||
},
|
|
||||||
methods: {
|
methods: {
|
||||||
observe,
|
observe,
|
||||||
initialize () {
|
initialize () {
|
||||||
|
|
|
@ -17,24 +17,6 @@ export function mouseover (node, callback) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function focusWithCapture (node, callback) {
|
|
||||||
node.addEventListener('focus', callback, true)
|
|
||||||
return {
|
|
||||||
destroy () {
|
|
||||||
node.removeEventListener('focus', callback, true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function blurWithCapture (node, callback) {
|
|
||||||
node.addEventListener('blur', callback, true)
|
|
||||||
return {
|
|
||||||
destroy () {
|
|
||||||
node.removeEventListener('blur', callback, true)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
export function selectionChange (node, callback) {
|
export function selectionChange (node, callback) {
|
||||||
let events = ['keyup', 'click', 'focus', 'blur']
|
let events = ['keyup', 'click', 'focus', 'blur']
|
||||||
let listener = () => {
|
let listener = () => {
|
||||||
|
|
Loading…
Reference in a new issue