diff --git a/src/lib/components/Keyboard.js b/src/lib/components/Keyboard.js index 1f201603..99b56b4f 100644 --- a/src/lib/components/Keyboard.js +++ b/src/lib/components/Keyboard.js @@ -1285,12 +1285,15 @@ class SimpleKeyboard { */ const buttonHasContainerStart = !disableRowButtonContainers && - button.includes("[") && - button.length > 1; + typeof button === "string" && + button.length > 1 && + button.indexOf("[") === 0; + const buttonHasContainerEnd = !disableRowButtonContainers && - button.includes("]") && - button.length > 1; + typeof button === "string" && + button.length > 1 && + button.indexOf("]") === button.length - 1; /** * Save container start index, if applicable