Skip to content

Commit 68deac6

Browse files
authored
Remove early return from error announcement logic (#3663)
1 parent 26e255b commit 68deac6

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

.changeset/seven-peaches-serve.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/view-components": patch
3+
---
4+
5+
When an error occurs in the SelectPanel, continue throwing the error

app/components/primer/alpha/select_panel_element.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -554,10 +554,8 @@ export class SelectPanelElement extends HTMLElement {
554554
// check if the errorElement is visible in the dom
555555
if (errorElement && !errorElement.hasAttribute('hidden')) {
556556
this.liveRegion.announceFromElement(errorElement, {politeness: 'assertive'})
557-
return
558557
}
559-
560-
break
558+
throw new Error((event as CustomEvent).detail.error)
561559
}
562560
}
563561
}

0 commit comments

Comments
 (0)