From 2afa6f0a639b13682ec46786e351d4ad4f3e61dd Mon Sep 17 00:00:00 2001 From: Francisco Hodge Date: Thu, 31 Jul 2025 18:47:40 -0400 Subject: [PATCH] Allow for buttonAttributes to omit "buttons" field. Remove outline style for useButtonTag. --- src/lib/components/Keyboard.ts | 15 +++++++++------ src/lib/components/css/Keyboard.css | 1 - 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/src/lib/components/Keyboard.ts b/src/lib/components/Keyboard.ts index 0870035e..af1c3ef2 100644 --- a/src/lib/components/Keyboard.ts +++ b/src/lib/components/Keyboard.ts @@ -1459,14 +1459,17 @@ class SimpleKeyboard { attrObj.attribute && typeof attrObj.attribute === "string" && attrObj.value && - typeof attrObj.value === "string" && - attrObj.buttons && - typeof attrObj.buttons === "string" + typeof attrObj.value === "string" ) { - const attrObjButtons = attrObj.buttons.split(" "); - - if (attrObjButtons.includes(button)) { + // If buttons is empty, undefined, or not a string, apply to all buttons + if (!attrObj.buttons || typeof attrObj.buttons !== "string") { callback(attrObj.attribute, attrObj.value); + } else { + const attrObjButtons = attrObj.buttons.split(" "); + + if (attrObjButtons.includes(button)) { + callback(attrObj.attribute, attrObj.value); + } } } else { console.warn( diff --git a/src/lib/components/css/Keyboard.css b/src/lib/components/css/Keyboard.css index 3747531d..bf95e3e6 100644 --- a/src/lib/components/css/Keyboard.css +++ b/src/lib/components/css/Keyboard.css @@ -24,7 +24,6 @@ /* When using option "useButtonTag" */ .hg-theme-default button.hg-button { border-width: 0; - outline: 0; font-size: inherit; }