Fixed #2219 - Calendar keydown event
parent
cc0e6c8580
commit
db46ee81af
|
@ -360,6 +360,17 @@ const CalendarEvents = [
|
|||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
name: "keydown",
|
||||
description: "Callback to invoke when a key is pressed.",
|
||||
arguments: [
|
||||
{
|
||||
name: "event",
|
||||
type: "object",
|
||||
description: "Keydown event"
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
|
||||
const CalendarSlots = [
|
||||
|
|
|
@ -335,6 +335,10 @@ export declare type CalendarEmits = {
|
|||
* @param {CalendarBlurEvent} event - Blur event
|
||||
*/
|
||||
'blur': (event: CalendarBlurEvent) => void;
|
||||
/**
|
||||
* Callback to invoke when a key is pressed.
|
||||
*/
|
||||
'keydown': (event: Event) => void;
|
||||
}
|
||||
|
||||
declare class Calendar extends ClassComponent<CalendarProps, CalendarSlots, CalendarEmits> { }
|
||||
|
|
|
@ -150,7 +150,7 @@ import Ripple from 'primevue/ripple';
|
|||
export default {
|
||||
name: 'Calendar',
|
||||
inheritAttrs: false,
|
||||
emits: ['show', 'hide', 'input', 'month-change', 'year-change', 'date-select', 'update:modelValue', 'today-click', 'clear-click', 'focus', 'blur'],
|
||||
emits: ['show', 'hide', 'input', 'month-change', 'year-change', 'date-select', 'update:modelValue', 'today-click', 'clear-click', 'focus', 'blur', 'keydown'],
|
||||
props: {
|
||||
modelValue: null,
|
||||
selectionMode: {
|
||||
|
@ -2157,6 +2157,8 @@ export default {
|
|||
//Noop
|
||||
break;
|
||||
}
|
||||
|
||||
this.$emit('keydown', event);
|
||||
},
|
||||
onInput(event) {
|
||||
try {
|
||||
|
|
|
@ -513,6 +513,11 @@ export default {
|
|||
</td>
|
||||
<td>Callback to invoke on blur of input field.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>keydown</td>
|
||||
<td>event: Keyboard event</td>
|
||||
<td>Callback to invoke when a key is pressed.</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue