1
1
Fork 0

Tag input autofocus on click

dev
Jan Kužílek 5 years ago
parent 0aea787ff5
commit b09550a522

@ -101,6 +101,8 @@ taginputs.forEach(function (tinput) {
newtag.addEventListener('click', (event) => { newtag.addEventListener('click', (event) => {
remove_selected(event.target.dataset.tagname) remove_selected(event.target.dataset.tagname)
// console.log(`Deselected: ${event.target.dataset.tagname}`) // console.log(`Deselected: ${event.target.dataset.tagname}`)
setTimeout(() => suggest_input.focus(), 2)
}) })
sel.appendChild(newtag) sel.appendChild(newtag)
@ -128,6 +130,8 @@ taginputs.forEach(function (tinput) {
element.addEventListener('click', (event) => { element.addEventListener('click', (event) => {
add_selected(event.target.dataset.tagname) add_selected(event.target.dataset.tagname)
event.preventDefault() event.preventDefault()
setTimeout(() => suggest_input.focus(), 2)
}) })
}) })
} }

@ -158,6 +158,8 @@ taginputs.forEach(function (tinput) {
newtag.addEventListener('click', (event) => { newtag.addEventListener('click', (event) => {
remove_selected(event.target.dataset.tagname) remove_selected(event.target.dataset.tagname)
// console.log(`Deselected: ${event.target.dataset.tagname}`) // console.log(`Deselected: ${event.target.dataset.tagname}`)
setTimeout(() => suggest_input.focus(), 2)
}) })
sel.appendChild(newtag) sel.appendChild(newtag)
@ -185,6 +187,8 @@ taginputs.forEach(function (tinput) {
element.addEventListener('click', (event) => { element.addEventListener('click', (event) => {
add_selected(event.target.dataset.tagname) add_selected(event.target.dataset.tagname)
event.preventDefault() event.preventDefault()
setTimeout(() => suggest_input.focus(), 2)
}) })
}) })
} }

Loading…
Cancel
Save