-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Description
Hi!
I noticed chrome android was setting which
and keyCode
to 229 since it's a soft keyboard. It seems like a relatively new thing they started doing. Anywho, I ended up just writing the following to make backspace and comma work on my android phone:
handleNonStandardKeyboards() {
const input = this.taggle.getInput()
input.addEventListener('keyup', e => {
const key = e.which || e.keyCode
const normalKeyboard = key !== 229
if (normalKeyboard) return
value = input.value
//back
const removing = value.length === 0
if (removing) {
const values = this.taggle.tag.values
this.taggle.remove(values[values.length - 1])
return
}
//comma
const endsWithComma = /,$/.test(value)
if (endsWithComma) {
const tag = value.replace(',', '')
this.taggle.add(tag)
input.value = ''
return
}
})
}
I haven't done extensive testing, but hope that helps anyone who runs into the same issue or someone who is more ambitious and willing to write a well-tested pull request.
piotrprzybytniewski
Metadata
Metadata
Assignees
Labels
No labels