From 7bd39eafdbbb4ac0f32ef790ce8f02241ed02689 Mon Sep 17 00:00:00 2001 From: Josh Schmidt Date: Thu, 26 Oct 2023 16:44:51 -0600 Subject: [PATCH] remove deprecated hideInput() and showInput() --- src/tom-select.ts | 23 +++-------------------- test/tests/setup.js | 2 +- 2 files changed, 4 insertions(+), 21 deletions(-) diff --git a/src/tom-select.ts b/src/tom-select.ts index 15006e2b..89da85ee 100644 --- a/src/tom-select.ts +++ b/src/tom-select.ts @@ -1107,7 +1107,7 @@ export default class TomSelect extends MicroPlugin(MicroEvent){ } // ensure control has focus - self.hideInput(); + self.inputState(); if (!self.isFocused) { self.focus(); } @@ -1230,7 +1230,7 @@ export default class TomSelect extends MicroPlugin(MicroEvent){ if( !activeItems.length ) return; - self.hideInput(); + self.inputState(); self.close(); self.activeItems = activeItems; @@ -1266,23 +1266,6 @@ export default class TomSelect extends MicroPlugin(MicroEvent){ self.wrapper.classList.toggle('input-hidden', self.isInputHidden ); } - /** - * Hides the input element out of view, while - * retaining its focus. - * @deprecated 1.3 - */ - hideInput() { - this.inputState(); - } - - /** - * Restores input visibility. - * @deprecated 1.3 - */ - showInput() { - this.inputState(); - } - /** * Get the input value */ @@ -2324,7 +2307,7 @@ export default class TomSelect extends MicroPlugin(MicroEvent){ self.setTextboxValue(); if (self.settings.mode === 'single' && self.items.length) { - self.hideInput(); + self.inputState(); } } diff --git a/test/tests/setup.js b/test/tests/setup.js index 138c72d4..c1308288 100644 --- a/test/tests/setup.js +++ b/test/tests/setup.js @@ -526,7 +526,7 @@ }); it_n('should not hide external control', function() { - test.instance.hideInput(); + test.instance.inputState(); assert.equal(test.instance.isInputHidden, false); });