Fixed #2921 - Password | missing required property

pull/2929/head
Tuğçe Küçükoğlu 2022-09-01 17:23:35 +03:00
parent 190f7d4400
commit 1d952f09cc
4 changed files with 22 additions and 1 deletions

View File

@ -83,6 +83,12 @@ const PasswordProps = [
default: "null", default: "null",
description: "Placeholder text for the input." description: "Placeholder text for the input."
}, },
{
name: "required",
type: "boolean",
default: "false",
description: "When present, it specifies that an input field must be filled out before submitting the form."
},
{ {
name: "inputId", name: "inputId",
type: "string", type: "string",

View File

@ -67,6 +67,11 @@ export interface PasswordProps extends InputHTMLAttributes {
* Placeholder text for the input. * Placeholder text for the input.
*/ */
placeholder?: string | undefined; placeholder?: string | undefined;
/**
* When present, it specifies that an input field must be filled out before submitting the form.
* Default value is false.
*/
required?: boolean | undefined;
/** /**
* Identifier of the underlying input element. * Identifier of the underlying input element.
*/ */

View File

@ -1,7 +1,7 @@
<template> <template>
<div :class="containerClass"> <div :class="containerClass">
<PInputText ref="input" :id="inputId" :type="inputType" :class="inputClass" :style="inputStyle" :value="modelValue" :aria-labelledby="ariaLabelledby" :aria-label="ariaLabel" <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" :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" v-bind="inputProps" />
<i v-if="toggleMask" :class="toggleIconClass" @click="onMaskToggle" /> <i v-if="toggleMask" :class="toggleIconClass" @click="onMaskToggle" />
<span class="p-hidden-accessible" aria-live="polite"> <span class="p-hidden-accessible" aria-live="polite">
@ -87,6 +87,10 @@ export default {
type: String, type: String,
default: null default: null
}, },
required: {
type: Boolean,
required: false
},
inputId: null, inputId: null,
inputClass: null, inputClass: null,
inputStyle: null, inputStyle: null,

View File

@ -167,6 +167,12 @@ import Password from 'primevue/password';
<td>null</td> <td>null</td>
<td>Placeholder text for the input.</td> <td>Placeholder text for the input.</td>
</tr> </tr>
<tr>
<td>required</td>
<td>boolean</td>
<td>false</td>
<td>When present, it specifies that an input field must be filled out before submitting the form.</td>
</tr>
<tr> <tr>
<td>inputId</td> <td>inputId</td>
<td>string</td> <td>string</td>