Refactor defaultFocus value

pull/1280/head^2
Cagatay Civici 2021-11-15 17:25:12 +03:00
parent cb9c6718ee
commit fa3aae4085
2 changed files with 3 additions and 4 deletions

View File

@ -106,11 +106,10 @@ export default {
return ['p-confirm-dialog-reject', this.confirmation ? (this.confirmation.rejectClass || 'p-button-text') : null]; return ['p-confirm-dialog-reject', this.confirmation ? (this.confirmation.rejectClass || 'p-button-text') : null];
}, },
autoFocusAccept() { autoFocusAccept() {
return this.confirmation.defaultFocus === 'accept' ? true : false; return (this.confirmation.defaultFocus === undefined || this.confirmation.defaultFocus === 'accept') ? true : false;
}, },
autoFocusReject() { autoFocusReject() {
// backward compatibility return this.confirmation.defaultFocus === 'reject' ? true : false;
return this.confirmation.defaultFocus !== 'accept' ? true : false;
} }
}, },
components: { components: {

View File

@ -195,7 +195,7 @@ export default {
<tr> <tr>
<td>defaultFocus</td> <td>defaultFocus</td>
<td>string</td> <td>string</td>
<td>null</td> <td>accept</td>
<td>Element to receive the focus when the dialog gets visible, valid values are "accept" and "reject".</td> <td>Element to receive the focus when the dialog gets visible, valid values are "accept" and "reject".</td>
</tr> </tr>
</tbody> </tbody>