mirror of
https://github.com/anatolykopyl/vue-highlights.git
synced 2026-03-27 05:15:38 +00:00
Compare commits
1 Commits
two-way-bi
...
fix-key-ev
| Author | SHA1 | Date | |
|---|---|---|---|
| c136bbe2bb |
@@ -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