Skip to content

Commit 71acfbd

Browse files
authored
fix: hide indicator and support native collapse on click (#35439)
1 parent 3739359 commit 71acfbd

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"type": "prerelease",
3+
"comment": "fix: hide dropdown indicator and support native collapse behavior on click",
4+
"packageName": "@fluentui/web-components",
5+
"email": "13071055+chrisdholt@users.noreply.github.com",
6+
"dependentChangeType": "patch"
7+
}

packages/web-components/src/dropdown/dropdown.base.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ export class BaseDropdown extends FASTElement {
650650

651651
this.focus();
652652

653-
if (target === this.control && !this.isCombobox) {
653+
if ((target === this.control || e.composedPath().includes(this.indicator)) && !this.isCombobox) {
654654
this.listbox.togglePopover();
655655
return true;
656656
}

packages/web-components/src/dropdown/dropdown.template.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import type { BaseDropdown } from './dropdown.base.js';
44
import type { DropdownOptions } from './dropdown.options.js';
55

66
const dropdownIndicatorTemplate = html<BaseDropdown>`
7-
<svg class="chevron-down-20-regular" role="button" slot="indicator" viewBox="0 0 20 20" ${ref('indicator')}>
7+
<svg class="chevron-down-20-regular" aria-hidden="true" slot="indicator" viewBox="0 0 20 20" ${ref('indicator')}>
88
<path
99
d="M15.85 7.65a.5.5 0 0 1 0 .7l-5.46 5.49a.55.55 0 0 1-.78 0L4.15 8.35a.5.5 0 1 1 .7-.7L10 12.8l5.15-5.16a.5.5 0 0 1 .7 0"
1010
fill="currentColor"

0 commit comments

Comments
 (0)