Skip to content

Commit a03b562

Browse files
committed
test(ac): change styles
1 parent 37ea30f commit a03b562

File tree

3 files changed

+9
-35
lines changed

3 files changed

+9
-35
lines changed

core/src/components/action-sheet/action-sheet.md.scss

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@
7474

7575
text-align: $action-sheet-md-text-align;
7676

77-
contain: content;
7877
overflow: hidden;
7978
}
8079

core/src/components/action-sheet/action-sheet.scss

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@
6060

6161
font-family: $font-family-base;
6262

63+
contain: strict;
6364
touch-action: none;
6465
user-select: none;
6566
z-index: $z-index-overlay;
@@ -82,13 +83,13 @@
8283
min-height: var(--min-height);
8384
max-height: var(--max-height);
8485

86+
contain: content;
87+
// opacity: 0;
8588
z-index: $z-index-overlay-wrapper;
86-
pointer-events: none;
8789
}
8890

8991
.action-sheet-button {
9092
display: block;
91-
position: relative;
9293

9394
width: 100%;
9495

@@ -101,7 +102,7 @@
101102

102103
font-family: inherit;
103104

104-
overflow: hidden;
105+
z-index: 0;
105106
}
106107

107108
.action-sheet-button:disabled {
@@ -113,18 +114,13 @@
113114
.action-sheet-button-inner {
114115
display: flex;
115116

116-
position: relative;
117-
118117
flex-flow: row nowrap;
119118
flex-shrink: 0;
120119
align-items: center;
121120
justify-content: center;
122-
pointer-events: none;
123121

124122
width: 100%;
125123
height: 100%;
126-
127-
z-index: 1;
128124
}
129125

130126
.action-sheet-container {

core/src/components/action-sheet/action-sheet.tsx

Lines changed: 5 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -253,27 +253,6 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
253253
return eventMethod(this.el, 'ionActionSheetWillDismiss');
254254
}
255255

256-
private focusFirstElement() {
257-
if (!this.wrapperEl) return; // Check if wrapperEl is defined
258-
const firstFocusable = this.wrapperEl?.querySelector(
259-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
260-
);
261-
if (firstFocusable) {
262-
(firstFocusable as HTMLElement).focus();
263-
}
264-
}
265-
266-
// Method to focus the last focusable element
267-
private focusLastElement() {
268-
if (!this.wrapperEl) return; // Check if wrapperEl is defined
269-
const focusableElements = this.wrapperEl.querySelectorAll(
270-
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
271-
);
272-
if (focusableElements.length > 0) {
273-
(focusableElements[focusableElements.length - 1] as HTMLElement).focus();
274-
}
275-
}
276-
277256
private async buttonClick(button: ActionSheetButton) {
278257
const role = button.role;
279258
if (isCancel(role)) {
@@ -406,23 +385,23 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
406385
>
407386
<ion-backdrop tappable={this.backdropDismiss} />
408387

409-
<div tabindex="0" aria-hidden="true" onFocus={() => this.focusLastElement()}></div>
388+
<div tabindex="0" aria-hidden="true"></div>
410389

411390
<div class="action-sheet-wrapper ion-overlay-wrapper" ref={(el) => (this.wrapperEl = el)}>
412391
<div class="action-sheet-container">
413392
<div class="action-sheet-group" ref={(el) => (this.groupEl = el)}>
414393
{header !== undefined && (
415-
<div
394+
<h2
416395
id={headerID}
417396
class={{
418397
'action-sheet-title': true,
419398
'action-sheet-has-sub-title': this.subHeader !== undefined,
420399
}}
421400
>
422401
{header}
423-
{this.subHeader && <div class="action-sheet-sub-title">{this.subHeader}</div>}
424-
</div>
402+
</h2>
425403
)}
404+
{this.subHeader && <h2 class="action-sheet-sub-title">{this.subHeader}</h2>}
426405
{buttons.map((b) => (
427406
<button
428407
{...b.htmlAttributes}
@@ -467,7 +446,7 @@ export class ActionSheet implements ComponentInterface, OverlayInterface {
467446
</div>
468447
</div>
469448

470-
<div tabindex="0" aria-hidden="true" onFocus={() => this.focusFirstElement()}></div>
449+
<div tabindex="0" aria-hidden="true"></div>
471450
</Host>
472451
);
473452
}

0 commit comments

Comments
 (0)