From 19566bda2ef57b8fcf6220818ffe5fdb9420c027 Mon Sep 17 00:00:00 2001 From: Nolan Lawson Date: Sun, 7 Jul 2019 11:43:35 -0700 Subject: [PATCH] fix: use focusin/focusout instead of custom events (#1308) --- src/routes/_components/timeline/Timeline.html | 9 ++------- src/routes/_utils/events.js | 18 ------------------ 2 files changed, 2 insertions(+), 25 deletions(-) diff --git a/src/routes/_components/timeline/Timeline.html b/src/routes/_components/timeline/Timeline.html index 5eaeff4e..684b3056 100644 --- a/src/routes/_components/timeline/Timeline.html +++ b/src/routes/_components/timeline/Timeline.html @@ -1,8 +1,8 @@

{label}

{#await componentsPromise} @@ -51,7 +51,6 @@ showMoreItemsForThread, showMoreItemsForCurrentTimeline } from '../../_actions/timeline' - import { focusWithCapture, blurWithCapture } from '../../_utils/events' import { scheduleIdleTask } from '../../_utils/scheduleIdleTask' import { mark, stop } from '../../_utils/marks' import isEqual from 'lodash-es/isEqual' @@ -141,10 +140,6 @@ } }, store: () => store, - events: { - focusWithCapture, - blurWithCapture - }, methods: { observe, initialize () { diff --git a/src/routes/_utils/events.js b/src/routes/_utils/events.js index e7951a95..05c3d8c9 100644 --- a/src/routes/_utils/events.js +++ b/src/routes/_utils/events.js @@ -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) { let events = ['keyup', 'click', 'focus', 'blur'] let listener = () => {