ShareLinks: stop injecting the guest-link button into form dialogs

The action-sheet fallback matched any dialog with 2+ buttons, which
caught the Add to Collection dialog and stuck a Create guest link
button next to OK. Skip containers that have a select/text input/
textarea, since real action sheets are just a list of buttons/links.
Cette révision appartient à :
Franciskid
2026-07-07 20:12:59 +02:00
Parent d965ecd66b
révision dfd41279a0
2 fichiers modifiés avec 6 ajouts et 2 suppressions
+4
Voir le fichier
@@ -423,6 +423,10 @@
}
function looksLikeActionContainer(node) {
if (node.querySelector('select, input:not([type="checkbox"]):not([type="radio"]), textarea')) {
return false;
}
var actions = Array.from(node.querySelectorAll('button, a, [role="menuitem"], [role="option"], .actionsheetMenuItem, .paperListButton'))
.filter(isVisible);
return actions.length >= 2 && actions.length <= 40;