mirror of
https://github.com/anatolykopyl/vue-highlights.git
synced 2026-03-26 21:05:35 +00:00
Compare commits
6 Commits
dependabot
...
fix-key-ev
| Author | SHA1 | Date | |
|---|---|---|---|
| c136bbe2bb | |||
| be21eb3897 | |||
|
|
8ebd12db49 | ||
|
|
4edb700cd8 | ||
|
|
3588880c50 | ||
|
|
148d8a9355 |
24158
package-lock.json
generated
24158
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@@ -67,8 +67,11 @@ export default {
|
||||
this.body = ''
|
||||
},
|
||||
onKeyUp (e) {
|
||||
const keysToIgnore = ['Shift', 'Meta', 'Control', 'Alt', 'ArrowUp', 'ArrowDown', 'ArrowLeft', 'ArrowRight']
|
||||
if (keysToIgnore.includes(e.key)) return
|
||||
|
||||
let caretPosition = this.getCaretPos()
|
||||
if (e.keyCode === 13) { // Enter key
|
||||
if (e.key === 'Enter') {
|
||||
caretPosition++
|
||||
}
|
||||
this.body = e.target.innerText
|
||||
|
||||
Reference in New Issue
Block a user