What is the best wat to get hold of an existing tomselect when using TypeScript with type safety #524
Unanswered
marceloverdijk
asked this question in
Q&A
Replies: 1 comment
-
|
For me, it works with an own interface. import TomSelect from 'tom-select';
interface HTMLElementTomSelect extends HTMLElement {
tomselect?: TomSelect;
} // interface HTMLElementTomSelect
// and then
const _tom_select = ($countryFilter as HTMLElementTomSelect).tomselect;
if (_tom_select) {
_tom_select.setValue(_value);
} // if (_tom_select)I think the TomInput interface (tom-select/src/types/core.ts) should be used, but I can't get it to work. export interface TomInput extends HTMLElement{
tomselect ?: TomSelect;
disabled : boolean;
readOnly ?: boolean;
required : boolean;
value : string;
type : string;
validity : ValidityState;
}maybe someone else may help out here? |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
What is the best wat to get hold of an existing tomselect when using TypeScript with type safety
Beta Was this translation helpful? Give feedback.
All reactions