Skip to content

Commit 606a892

Browse files
authored
fix(select): hide notch cutout if no visible label provided (#27649)
1 parent d44422e commit 606a892

File tree

3 files changed

+21
-2
lines changed

3 files changed

+21
-2
lines changed

core/src/components/select/select.scss

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,8 @@ button {
316316
* then the element should be hidden otherwise
317317
* there will be additional margins added.
318318
*/
319-
.label-text-wrapper-hidden {
319+
.label-text-wrapper-hidden,
320+
.select-outline-notch-hidden {
320321
display: none;
321322
}
322323

core/src/components/select/select.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,12 @@ export class Select implements ComponentInterface {
910910
return [
911911
<div class="select-outline-container">
912912
<div class="select-outline-start"></div>
913-
<div class="select-outline-notch">
913+
<div
914+
class={{
915+
'select-outline-notch': true,
916+
'select-outline-notch-hidden': !this.hasLabel,
917+
}}
918+
>
914919
<div class="notch-spacer" aria-hidden="true" ref={(el) => (this.notchSpacerEl = el)}>
915920
{this.label}
916921
</div>

core/src/components/select/test/fill/select.e2e.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,4 +224,17 @@ configs({ modes: ['md'], directions: ['ltr'] }).forEach(({ title, screenshot, co
224224
expect(await select.screenshot()).toMatchSnapshot(screenshot(`select-fill-outline-hidden-slotted-label`));
225225
});
226226
});
227+
test.describe(title('select: notch cutout'), () => {
228+
test('notch cutout should be hidden when no label is passed', async ({ page }) => {
229+
await page.setContent(
230+
`
231+
<ion-select fill="outline" label-placement="stacked" aria-label="my select"></ion-select>
232+
`,
233+
config
234+
);
235+
236+
const notchCutout = page.locator('ion-select .select-outline-notch');
237+
await expect(notchCutout).toBeHidden();
238+
});
239+
});
227240
});

0 commit comments

Comments
 (0)