dev(webui): add forceShowOptions
prop to Selector for debugging purposes
This commit is contained in:
parent
dddc16ea69
commit
8fda6fba65
1 changed files with 3 additions and 1 deletions
|
@ -108,6 +108,7 @@
|
||||||
export let placeholder = '';
|
export let placeholder = '';
|
||||||
export let disabled = false;
|
export let disabled = false;
|
||||||
export let keepFocusOnSet = false;
|
export let keepFocusOnSet = false;
|
||||||
|
export let forceShowOptions = false;
|
||||||
|
|
||||||
export let initial: SelectorValue | undefined = undefined;
|
export let initial: SelectorValue | undefined = undefined;
|
||||||
let inputValue = '';
|
let inputValue = '';
|
||||||
|
@ -449,7 +450,8 @@
|
||||||
let inputFocused = false;
|
let inputFocused = false;
|
||||||
let hover = false; // otherwise clicking makes options disappear faster than it can emit a set
|
let hover = false; // otherwise clicking makes options disappear faster than it can emit a set
|
||||||
$: visible =
|
$: visible =
|
||||||
(inputFocused || hover || optionFocusIndex > -1) && Boolean(options.length || updating);
|
((inputFocused || hover || optionFocusIndex > -1) && Boolean(options.length || updating)) ||
|
||||||
|
forceShowOptions;
|
||||||
$: dispatch('focus', inputFocused || hover || optionFocusIndex > -1);
|
$: dispatch('focus', inputFocused || hover || optionFocusIndex > -1);
|
||||||
|
|
||||||
$: dbg('%o focus = %s, hover = %s, visible = %s', selectorEl, inputFocused, hover, visible);
|
$: dbg('%o focus = %s, hover = %s, visible = %s', selectorEl, inputFocused, hover, visible);
|
||||||
|
|
Loading…
Reference in a new issue