Explicitly disable native drop down menu on UWP.

This commit is contained in:
Bradley Eaton
2025-06-30 16:44:54 +01:00
parent 54b6d4015c
commit 12bbcb0048

View File

@@ -7,8 +7,9 @@ import 'webcomponents.js/webcomponents-lite';
const EmbySelectPrototype = Object.create(HTMLSelectElement.prototype);
function enableNativeMenu() {
// WebView 2 creates dropdown that doesn't work with controller.
if (browser.edgeUwp || browser.xboxOne) {
return true;
return false;
}
// Doesn't seem to work at all
@@ -80,7 +81,7 @@ function onMouseDown(e) {
function onKeyDown(e) {
// Xbox controller for UWP WebView2 uses keycode 195 to select.
if (e.keyCode === 13 && !enableNativeMenu() || (e.keyCode === 195 && browser.edgeChromium)) {
if ((e.keyCode === 13 || e.keyCode === 195) && !enableNativeMenu()) {
e.preventDefault();
showActionSheet(this);
}