mirror of
https://github.com/hodgef/simple-keyboard.git
synced 2026-04-30 00:00:04 +08:00
Adding types for recurseButtons method. Per https://github.com/hodgef/react-simple-keyboard/issues/960
This commit is contained in:
@@ -880,7 +880,7 @@ class SimpleKeyboard {
|
||||
* Execute an operation on each button
|
||||
*/
|
||||
recurseButtons(fn) {
|
||||
if (!fn) return false;
|
||||
if (!fn) return;
|
||||
|
||||
Object.keys(this.buttonElements).forEach(buttonName =>
|
||||
this.buttonElements[buttonName].forEach(fn)
|
||||
|
||||
@@ -1376,7 +1376,7 @@ it('Keyboard buttonAttribute will warn about invalid entries', () => {
|
||||
it('Keyboard recurseButtons will not work without a valid param', () => {
|
||||
setDOM();
|
||||
const keyboard = new Keyboard();
|
||||
expect(keyboard.recurseButtons()).toBe(false);
|
||||
expect(keyboard.recurseButtons()).toBeFalsy();
|
||||
});
|
||||
|
||||
it('Keyboard will not work with a DOM element param without class', () => {
|
||||
|
||||
Reference in New Issue
Block a user