From ad1fae5b664a7eea76e3abb0f46ca6de95545d15 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Tue, 1 Feb 2022 16:43:09 +0000 Subject: [PATCH] :bug: Fixes clearFilterInput Safari bug (#463) (Sentry: 2911601158) --- src/components/Settings/SettingsContainer.vue | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/components/Settings/SettingsContainer.vue b/src/components/Settings/SettingsContainer.vue index 19e93e34..fbb86a36 100644 --- a/src/components/Settings/SettingsContainer.vue +++ b/src/components/Settings/SettingsContainer.vue @@ -100,11 +100,13 @@ export default { this.settingsVisible = this.getSettingsVisibility(); }, methods: { + /* Emit event to begin/ continue searching */ userIsTypingSomething(something) { this.$emit('user-is-searchin', something); }, + /* Call function to clear search field, remove focus and reset results */ clearFilterInput() { - this.$refs.SearchBar.clearFilterInput(); + if (this.$refs.SearchBar) this.$refs.SearchBar.clearFilterInput(); }, getInitialTheme() { return this.appConfig.theme || ''; @@ -115,10 +117,12 @@ export default { if (typeof userThemes === 'string') return [userThemes]; return userThemes; }, + /* Show / hide settings */ toggleSettingsVisibility() { this.settingsVisible = !this.settingsVisible; localStorage.setItem(localStorageKeys.HIDE_SETTINGS, this.settingsVisible); }, + /* Get initial settings visibility, either from appConfig, local storage or browser type */ getSettingsVisibility() { const screenWidth = document.body.clientWidth; if (screenWidth && screenWidth < 600) return false;