mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-19 03:32:21 +08:00
chore(): sync with main
This commit is contained in:
@ -163,7 +163,6 @@ export class Segment implements ComponentInterface {
|
||||
|
||||
async componentDidLoad() {
|
||||
this.setCheckedClasses();
|
||||
this.ensureFocusable();
|
||||
|
||||
this.gesture = (await import('../../utils/gesture')).createGesture({
|
||||
el: this.el,
|
||||
@ -537,19 +536,7 @@ export class Segment implements ComponentInterface {
|
||||
this.emitValueChange();
|
||||
}
|
||||
}
|
||||
current.focus();
|
||||
}
|
||||
|
||||
/* By default, focus is delegated to the selected `ion-segment-button`.
|
||||
* If there is no selected button, focus will instead pass to the first child button.
|
||||
**/
|
||||
private ensureFocusable() {
|
||||
if (this.value !== undefined) {
|
||||
return;
|
||||
}
|
||||
|
||||
const buttons = this.getButtons();
|
||||
buttons[0]?.setAttribute('tabindex', '0');
|
||||
current.setFocus();
|
||||
}
|
||||
|
||||
render() {
|
||||
|
Reference in New Issue
Block a user