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 = [
|
const CalendarSlots = [
|
||||||
|
|
|
@ -335,6 +335,10 @@ export declare type CalendarEmits = {
|
||||||
* @param {CalendarBlurEvent} event - Blur event
|
* @param {CalendarBlurEvent} event - Blur event
|
||||||
*/
|
*/
|
||||||
'blur': (event: CalendarBlurEvent) => void;
|
'blur': (event: CalendarBlurEvent) => void;
|
||||||
|
/**
|
||||||
|
* Callback to invoke when a key is pressed.
|
||||||
|
*/
|
||||||
|
'keydown': (event: Event) => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
declare class Calendar extends ClassComponent<CalendarProps, CalendarSlots, CalendarEmits> { }
|
declare class Calendar extends ClassComponent<CalendarProps, CalendarSlots, CalendarEmits> { }
|
||||||
|
|
|
@ -150,7 +150,7 @@ import Ripple from 'primevue/ripple';
|
||||||
export default {
|
export default {
|
||||||
name: 'Calendar',
|
name: 'Calendar',
|
||||||
inheritAttrs: false,
|
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: {
|
props: {
|
||||||
modelValue: null,
|
modelValue: null,
|
||||||
selectionMode: {
|
selectionMode: {
|
||||||
|
@ -2157,6 +2157,8 @@ export default {
|
||||||
//Noop
|
//Noop
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.$emit('keydown', event);
|
||||||
},
|
},
|
||||||
onInput(event) {
|
onInput(event) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -513,6 +513,11 @@ export default {
|
||||||
</td>
|
</td>
|
||||||
<td>Callback to invoke on blur of input field.</td>
|
<td>Callback to invoke on blur of input field.</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>keydown</td>
|
||||||
|
<td>event: Keyboard event</td>
|
||||||
|
<td>Callback to invoke when a key is pressed.</td>
|
||||||
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
|
Loading…
Reference in New Issue