Skip to content

Commit

Permalink
fix(QInput): re-emit keydown and animationend events #11120 (#14866)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdanpdan committed Nov 14, 2022
1 parent 1b7b63b commit 27d49ae
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
10 changes: 8 additions & 2 deletions ui/src/components/input/QInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ export default createComponent({

emits: [
...useFieldEmits,
'paste', 'change'
'paste', 'change',
'keydown', 'animationend'
],

setup (props, { emit, attrs }) {
Expand Down Expand Up @@ -98,7 +99,7 @@ export default createComponent({
}

if (props.autogrow === true) {
evt.onAnimationend = adjustHeight
evt.onAnimationend = onAnimationend
}

return evt
Expand Down Expand Up @@ -253,6 +254,11 @@ export default createComponent({
props.autogrow === true && adjustHeight()
}

function onAnimationend (e) {
emit('animationend', e)
adjustHeight()
}

function emitValue (val, stopWatcher) {
emitValueFn = () => {
if (
Expand Down
2 changes: 2 additions & 0 deletions ui/src/components/input/use-mask.js
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ export default function (props, emit, emitValue, inputRef) {
}

function onMaskedKeydown (e) {
emit('keydown', e)

if (shouldIgnoreKey(e) === true) {
return
}
Expand Down

0 comments on commit 27d49ae

Please sign in to comment.