Backspace ignored if no value
Error in console.

I have the same error
Thanks for reporting! Gonna work on this in a few days unless someone wants to pick this up :)
Found the line multiselectMixin.js#L602. Option is undefined and should be checked first. The undefined option comes from here multiselectMixin.js#L635.
@shentao hi! Can you say when planned release with this fix?
hey, @NoahStahl, @juanpscotto, @phlegx, @Alex-Sokolov, and @shentao a long story short, I solved the issue for me by utilizing the blockKeys prop like so
multiselect(
v-model="value"
:options="options"
:block-keys="['Delete']"
)
search for blockKeys here http://localhost:8080/#sub-props
How I found this was I followed the errors to the removeLastElement function. I saw here a function guard utilizing blockKeys to prevent the Delete key from triggering removeElement, but this is not the default value, so when the drop-down is active, and you hit the escape key, a search action will trigger.
This results in this.internalValue[this.internalValue.length - 1] evaluating to undefined, since the array is empty, hence why option is undefined.
removeLastElement () {
/* istanbul ignore else */
if (this.blockKeys.indexOf('Delete') !== -1) return
/* istanbul ignore else */
if (this.search.length === 0 && Array.isArray(this.internalValue) {
this.removeElement(this.internalValue[this.internalValue.length - 1], false)
}
}
It's seems reasonable to set ['Delete'] as a default value to blockKeys or always return when the escape key is pressed as it doesnt' seem to serve any purpose when searching or selecing anyways (as far as I can tell at least).
/**
* Array of keyboard keys to block
* when selecting
* @default 1000
* @type {String}
*/
blockKeys: {
type: Array,
default () {
return ['Delete']
}
}
anyways, I hope this helps :)
@dgriego Thanks man!! I tried that trick you said and it works well!. Thanks for the help.
Thanks for PR #939, @phlegx :+1: Looking forward to the patch
Most helpful comment
hey, @NoahStahl, @juanpscotto, @phlegx, @Alex-Sokolov, and @shentao a long story short, I solved the issue for me by utilizing the
blockKeysprop like sosearch for
blockKeyshere http://localhost:8080/#sub-propsHow I found this was I followed the errors to the
removeLastElementfunction. I saw here a function guard utilizingblockKeysto prevent the Delete key from triggeringremoveElement, but this is not the default value, so when the drop-down is active, and you hit the escape key, a search action will trigger.This results in
this.internalValue[this.internalValue.length - 1]evaluating toundefined, since the array is empty, hence whyoptionis undefined.It's seems reasonable to set
['Delete']as a default value toblockKeysor always return when the escape key is pressed as it doesnt' seem to serve any purpose when searching or selecing anyways (as far as I can tell at least).anyways, I hope this helps :)