Fixed #2880 - Password: Unable to add invalid event listener after 3.16

pull/2929/head
Tuğçe Küçükoğlu 2022-09-01 17:25:54 +03:00
parent 1d952f09cc
commit 133291b6d3
1 changed files with 5 additions and 2 deletions

View File

@ -2,7 +2,7 @@
<div :class="containerClass">
<PInputText ref="input" :id="inputId" :type="inputType" :class="inputClass" :style="inputStyle" :value="modelValue" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel"
:aria-controls="(panelProps&&panelProps.id)||panelId||panelUniqueId" :aria-expanded="overlayVisible" :aria-haspopup="true" :placeholder="placeholder" :required="required"
@input="onInput" @focus="onFocus" @blur="onBlur" @keyup="onKeyUp" v-bind="inputProps" />
@input="onInput" @focus="onFocus" @blur="onBlur" @keyup="onKeyUp" @invalid="onInvalid" v-bind="inputProps" />
<i v-if="toggleMask" :class="toggleIconClass" @click="onMaskToggle" />
<span class="p-hidden-accessible" aria-live="polite">
{{infoText}}
@ -32,7 +32,7 @@ import Portal from 'primevue/portal';
export default {
name: 'Password',
emits: ['update:modelValue', 'change', 'focus', 'blur'],
emits: ['update:modelValue', 'change', 'focus', 'blur', 'invalid'],
props: {
modelValue: String,
promptLabel: {
@ -245,6 +245,9 @@ export default {
}
}
},
onInvalid(event) {
this.$emit('invalid', event);
},
bindScrollListener() {
if (!this.scrollHandler) {
this.scrollHandler = new ConnectedOverlayScrollHandler(this.$refs.input.$el, () => {