mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2026-04-11 00:02:15 +08:00
Allow for buttonAttributes to omit "buttons" field. Remove outline style for useButtonTag.
This commit is contained in:
@@ -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(
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
/* When using option "useButtonTag" */
|
||||
.hg-theme-default button.hg-button {
|
||||
border-width: 0;
|
||||
outline: 0;
|
||||
font-size: inherit;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user