Open stv8 opened 1 year ago
@stv8 nice spot, thanks. I'll update to a function expression
Awesome!
After looking at the source a little further, I realized I actually am looking to hook into handleMultItemClear
.
Rather than completely overriding it, could it be possible to hook into the call prior to it clearing?
Like I mentioned above, my use case is to prompt the user to confirm they really want to delete an item from a multi item list to prevent erroneous deletes by accidentally clicking backspace etc. So I would like to ultimately keep the original clearing logic of handleMultItemClear
to be called when the user confirms.
Of course don't let my one use case drive your design decisions, but let me know if you would like any other input on this one, let me know what you think or if you would like me some assistance.
Cheers
Just to chime in on this one as it is in the same code. The clear event is confusing and seems wrong to me. When removing a single item from a multi select should it not just fire a change event. The user is not clearing the value.
Hello! Apologies if this is a dumb question as I am still getting accustomed to svelte.
I would like to override
handleClear()
to additionally prompt the user to confirm they really want to clear the item. If they confirm they do then I would like to call the originalhandleClear
function.According to your documentation, we should be able to override the
handleClear
method, however my attempts have been futile.This is what I have tried:
But it doesn't appear to be overriding. I found this after some brief research
source
Since
handleClear
is defined as afunction
and not a function expression, I think that might preventing me from overriding it.Is there a way to accomplish this or am I misunderstanding something?
Thanks for your library and work by the way!