mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-18 03:00:58 +08:00
refactor(alert): switch ev.code to ev.key (#27023)
This commit is contained in:
@ -185,13 +185,13 @@ export class Alert implements ComponentInterface, OverlayInterface {
|
|||||||
|
|
||||||
// If hitting arrow down or arrow right, move to the next radio
|
// If hitting arrow down or arrow right, move to the next radio
|
||||||
// If we're on the last radio, move to the first radio
|
// If we're on the last radio, move to the first radio
|
||||||
if (['ArrowDown', 'ArrowRight'].includes(ev.code)) {
|
if (['ArrowDown', 'ArrowRight'].includes(ev.key)) {
|
||||||
nextEl = index === radios.length - 1 ? radios[0] : radios[index + 1];
|
nextEl = index === radios.length - 1 ? radios[0] : radios[index + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
// If hitting arrow up or arrow left, move to the previous radio
|
// If hitting arrow up or arrow left, move to the previous radio
|
||||||
// If we're on the first radio, move to the last radio
|
// If we're on the first radio, move to the last radio
|
||||||
if (['ArrowUp', 'ArrowLeft'].includes(ev.code)) {
|
if (['ArrowUp', 'ArrowLeft'].includes(ev.key)) {
|
||||||
nextEl = index === 0 ? radios[radios.length - 1] : radios[index - 1];
|
nextEl = index === 0 ? radios[radios.length - 1] : radios[index - 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user