From fa42daf2b9a8734f8d9bb41402379438bd5fcf65 Mon Sep 17 00:00:00 2001 From: Maicol Battistini Date: Wed, 1 Dec 2021 18:28:54 +0100 Subject: [PATCH] =?UTF-8?q?fix(setuppage):=20=F0=9F=90=9B=20Fix=20select?= =?UTF-8?q?=20lingua?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- resources/js/Views/SetupPage.jsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/resources/js/Views/SetupPage.jsx b/resources/js/Views/SetupPage.jsx index 4b84c092e..5f7216b4f 100644 --- a/resources/js/Views/SetupPage.jsx +++ b/resources/js/Views/SetupPage.jsx @@ -208,7 +208,7 @@ export default class SetupPage extends Page { .toggleClass('mdc-high-contrast'); }); - $('mwc-select#language-select').on('action', this.onLanguageSelected); + $('#language-select').on('action', this.onLanguageSelected); // Fix for mwc button inside tags $('a') @@ -226,7 +226,10 @@ export default class SetupPage extends Page { } onLanguageSelected(event: Event) { - window.location.href = window.route('app.language', {language: event.target.value}); + const {detail, target: select} = event; + const selected = $(select).find(`mwc-list-item:nth-child(${detail.index + 1}) [slot="graphic"] img`); + $(select).find('[slot="icon"] img').attr('src', selected.attr('src')); + window.location.href = window.route('app.language', {language: select.value}); } async testDatabase(silentSuccess = false, silentError = false): boolean {