This repository was archived by the owner on Apr 17, 2022. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +18
-14
lines changed
Expand file tree Collapse file tree 2 files changed +18
-14
lines changed Original file line number Diff line number Diff line change 196196 });
197197 const slots = useSlots ();
198198 const isOpen = ref (false );
199- const valueCleared = ref (false );
200199 const modelValue = toRef (props , ' modelValue' );
201200
202201 onMounted (() => {
314313
315314 const openMenu = (): void => {
316315 if (! props .disabled && ! props .readonly ) {
317- if (! valueCleared .value ) {
318- setMenuPosition ();
319- isOpen .value = ! isOpen .value ;
316+ setMenuPosition ();
317+ isOpen .value = ! isOpen .value ;
320318
321- if (! isOpen .value ) {
322- clearInternalValues ();
323- }
319+ if (! isOpen .value ) {
320+ clearInternalValues ();
324321 }
325- valueCleared .value = false ;
326322 parseExternalModelValue (props .modelValue );
327323 }
328324 };
332328 * for the modelValue and clear internally stored data
333329 */
334330 const clearValue = (): void => {
335- valueCleared .value = true ;
336331 inputValue .value = ' ' ;
337332 clearInternalValues ();
338333 emit (' update:modelValue' , null );
Original file line number Diff line number Diff line change 2929 @keydown.tab =" handleTab"
3030 @focus =" handleFocus"
3131 />
32- <span class =" dp__input_icon" v-if =" $slots['input-icon'] && !hideInputIcon" ><slot name =" input-icon" /></span >
33- <CalendarIcon v-if =" !$slots['input-icon'] && !hideInputIcon" class =" dp__input_icon dp__input_icons" />
32+ <span class =" dp__input_icon" v-if =" $slots['input-icon'] && !hideInputIcon" @click =" stopPropagation"
33+ ><slot name =" input-icon"
34+ /></span >
35+ <CalendarIcon
36+ v-if =" !$slots['input-icon'] && !hideInputIcon"
37+ class =" dp__input_icon dp__input_icons"
38+ @click =" stopPropagation"
39+ />
3440 <span
3541 class =" dp__clear_icon"
3642 v-if =" $slots['clear-icon'] && clearable && !disabled && !readonly"
4046 <CancelIcon
4147 v-if =" clearable && !$slots['clear-icon'] && inputValue && !disabled && !readonly"
4248 class =" dp__clear_icon dp__input_icons"
43- @click.prevent =" onClear"
49+ @click.stop. prevent =" onClear"
4450 />
4551 </div >
4652 </div >
124130 }
125131 };
126132
127- const handleOpen = (e : Event ) => {
128- e .stopImmediatePropagation ();
133+ const handleOpen = () => {
129134 if (props .textInput && props .textInputOptions ?.openMenu && ! props .isMenuOpen ) {
130135 emit (' open' );
131136 } else if (! props .textInput ) {
132137 emit (' open' );
133138 }
134139 };
135140
141+ const stopPropagation = (e : Event ) => {
142+ e .stopImmediatePropagation ();
143+ };
144+
136145 const onClear = () => {
137146 emit (' clear' );
138147 };
You can’t perform that action at this time.
0 commit comments