@react-aria/listbox 3.15.0 → 3.15.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"mappings":";;;;;AAeA;IACE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAA;CACnD;AAED,OAAO,MAAM,UAAU,OAAO,CAAC,UAAU,OAAO,CAAC,EAAE,QAAQ,CAA+C,CAAC;AAU3G,0BAA0B,CAAC,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,GAAG,MAAM,CAQtE;ACtBD;IACE,qCAAqC;IACrC,YAAY,EAAE,aAAa,CAAC;IAC5B,6DAA6D;IAC7D,UAAU,EAAE,aAAa,CAAA;CAC1B;AAED,oCAAoC,CAAC,CAAE,SAAQ,IAAI,CAAC,iBAAiB,CAAC,CAAC,EAAE,UAAU,CAAC;IAClF,kDAAkD;IAClD,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,gBAAgB,CAAC;IAEpC;;;;OAIG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;IAEhC;;OAEG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;;;;OAMG;IACH,YAAY,CAAC,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU,CAAA;CACnD;AAED;;;;;GAKG;AACH,2BAA2B,CAAC,EAAE,KAAK,EAAE,mBAAmB,CAAC,CAAC,EAAE,KAAK,EAAE,UAAU,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B,GAAG,kBAAkB,CAqBpF;AC3CD,YAAY,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC","sources":["packages/@react-aria/listbox/src/packages/@react-aria/listbox/src/utils.ts","packages/@react-aria/listbox/src/packages/@react-aria/listbox/src/useListBox.ts","packages/@react-aria/listbox/src/packages/@react-aria/listbox/src/useOption.ts","packages/@react-aria/listbox/src/packages/@react-aria/listbox/src/useListBoxSection.ts","packages/@react-aria/listbox/src/packages/@react-aria/listbox/src/index.ts","packages/@react-aria/listbox/src/index.ts"],"sourcesContent":[null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useListBox} from './useListBox';\nexport {useOption} from './useOption';\nexport {useListBoxSection} from './useListBoxSection';\nexport {listData, getItemId} from './utils';\n\nexport type {AriaListBoxProps} from '@react-types/listbox';\nexport type {AriaListBoxOptions, ListBoxAria} from './useListBox';\nexport type {AriaOptionProps, OptionAria} from './useOption';\nexport type {AriaListBoxSectionProps, ListBoxSectionAria} from './useListBoxSection';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";;;;;AAeA;IACE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,KAAK,IAAI,CAAC;IAC9B,YAAY,CAAC,EAAE,QAAQ,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AE,OAAO,CAAC;IAErB,iDAAiD;IACjD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,qCAAqC;IACrC,GAAG,EAAE,GAAG,CAAC;IAET;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAEhC;;;OAGG;IACH,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAE7B;;;OAGG;IACH,aAAa,CAAC,EAAE,OAAO,CAAC;IAExB;;;OAGG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAA;CAChC;AAED;;;;;GAKG;AACH,0BAA0B,CAAC,EAAE,KAAK,EAAE,eAAe,EAAE,KAAK,EAAE,UAAU,CAAC,CAAC,EAAE,GAAG,EAAE,UAAU,gBAAgB,GAAG,IAAI,CAAC,GAAG,UAAU,CA2F7H;AClKD;IACE,mCAAmC;IACnC,OAAO,CAAC,EAAE,SAAS,CAAC;IACpB,oFAAoF;IACpF,YAAY,CAAC,EAAE,MAAM,CAAA;CACtB;AAED;IACE,uCAAuC;IACvC,SAAS,EAAE,aAAa,CAAC;IAEzB,6CAA6C;IAC7C,YAAY,EAAE,aAAa,CAAC;IAE5B,mCAAmC;IACnC,UAAU,EAAE,aAAa,CAAA;CAC1B;AAED;;;;GAIG;AACH,kCAAkC,KAAK,EAAE,uBAAuB,GAAG,kBAAkB,CAyBpF;AC/CD,YAAY,EAAC,gBAAgB,EAAC,MAAM,sBAAsB,CAAC","sources":["packages/@react-aria/listbox/src/packages/@react-aria/listbox/src/utils.ts","packages/@react-aria/listbox/src/packages/@react-aria/listbox/src/useListBox.ts","packages/@react-aria/listbox/src/packages/@react-aria/listbox/src/useOption.ts","packages/@react-aria/listbox/src/packages/@react-aria/listbox/src/useListBoxSection.ts","packages/@react-aria/listbox/src/packages/@react-aria/listbox/src/index.ts","packages/@react-aria/listbox/src/index.ts"],"sourcesContent":[null,null,null,null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nexport {useListBox} from './useListBox';\nexport {useOption} from './useOption';\nexport {useListBoxSection} from './useListBoxSection';\nexport {listData, getItemId} from './utils';\n\nexport type {AriaListBoxProps} from '@react-types/listbox';\nexport type {AriaListBoxOptions, ListBoxAria} from './useListBox';\nexport type {AriaOptionProps, OptionAria} from './useOption';\nexport type {AriaListBoxSectionProps, ListBoxSectionAria} from './useListBoxSection';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
@@ -25,11 +25,15 @@ function $f32afd5f225c3320$export$c3f9f39876e4bc7(props) {
25
25
  role: 'presentation'
26
26
  },
27
27
  headingProps: heading ? {
28
- // Techincally, listbox cannot contain headings according to ARIA.
28
+ // Technically, listbox cannot contain headings according to ARIA.
29
29
  // We hide the heading from assistive technology, using role="presentation",
30
30
  // and only use it as a visual label for the nested group.
31
31
  id: headingId,
32
- role: 'presentation'
32
+ role: 'presentation',
33
+ onMouseDown: (e)=>{
34
+ // Prevent DOM focus from moving on mouse down when using virtual focus
35
+ e.preventDefault();
36
+ }
33
37
  } : {},
34
38
  groupProps: {
35
39
  role: 'group',
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AA6BM,SAAS,yCAAkB,KAA8B;IAC9D,IAAI,WAAC,OAAO,EAAE,cAAc,SAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,2BAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UAAU;YACtB,kEAAkE;YAClE,4EAA4E;YAC5E,0DAA0D;YAC1D,IAAI;YACJ,MAAM;QACR,IAAI,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF","sources":["packages/@react-aria/listbox/src/useListBoxSection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '@react-aria/utils';\n\nexport interface AriaListBoxSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface ListBoxSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Techincally, listbox cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a visual label for the nested group.\n id: headingId,\n role: 'presentation'\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useListBoxSection.main.js.map"}
1
+ {"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC;AA6BM,SAAS,yCAAkB,KAA8B;IAC9D,IAAI,WAAC,OAAO,EAAE,cAAc,SAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,2BAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UAAU;YACtB,kEAAkE;YAClE,4EAA4E;YAC5E,0DAA0D;YAC1D,IAAI;YACJ,MAAM;YACN,aAAa,CAAC;gBACZ,uEAAuE;gBACvE,EAAE,cAAc;YAClB;QACF,IAAI,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF","sources":["packages/@react-aria/listbox/src/useListBoxSection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '@react-aria/utils';\n\nexport interface AriaListBoxSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface ListBoxSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Technically, listbox cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a visual label for the nested group.\n id: headingId,\n role: 'presentation',\n onMouseDown: (e) => {\n // Prevent DOM focus from moving on mouse down when using virtual focus\n e.preventDefault();\n }\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useListBoxSection.main.js.map"}
@@ -19,11 +19,15 @@ function $af383d3bef1cfdc9$export$c3f9f39876e4bc7(props) {
19
19
  role: 'presentation'
20
20
  },
21
21
  headingProps: heading ? {
22
- // Techincally, listbox cannot contain headings according to ARIA.
22
+ // Technically, listbox cannot contain headings according to ARIA.
23
23
  // We hide the heading from assistive technology, using role="presentation",
24
24
  // and only use it as a visual label for the nested group.
25
25
  id: headingId,
26
- role: 'presentation'
26
+ role: 'presentation',
27
+ onMouseDown: (e)=>{
28
+ // Prevent DOM focus from moving on mouse down when using virtual focus
29
+ e.preventDefault();
30
+ }
27
31
  } : {},
28
32
  groupProps: {
29
33
  role: 'group',
@@ -19,11 +19,15 @@ function $af383d3bef1cfdc9$export$c3f9f39876e4bc7(props) {
19
19
  role: 'presentation'
20
20
  },
21
21
  headingProps: heading ? {
22
- // Techincally, listbox cannot contain headings according to ARIA.
22
+ // Technically, listbox cannot contain headings according to ARIA.
23
23
  // We hide the heading from assistive technology, using role="presentation",
24
24
  // and only use it as a visual label for the nested group.
25
25
  id: headingId,
26
- role: 'presentation'
26
+ role: 'presentation',
27
+ onMouseDown: (e)=>{
28
+ // Prevent DOM focus from moving on mouse down when using virtual focus
29
+ e.preventDefault();
30
+ }
27
31
  } : {},
28
32
  groupProps: {
29
33
  role: 'group',
@@ -1 +1 @@
1
- {"mappings":";;AAAA;;;;;;;;;;CAUC;AA6BM,SAAS,yCAAkB,KAA8B;IAC9D,IAAI,WAAC,OAAO,EAAE,cAAc,SAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,YAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UAAU;YACtB,kEAAkE;YAClE,4EAA4E;YAC5E,0DAA0D;YAC1D,IAAI;YACJ,MAAM;QACR,IAAI,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF","sources":["packages/@react-aria/listbox/src/useListBoxSection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '@react-aria/utils';\n\nexport interface AriaListBoxSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface ListBoxSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Techincally, listbox cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a visual label for the nested group.\n id: headingId,\n role: 'presentation'\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useListBoxSection.module.js.map"}
1
+ {"mappings":";;AAAA;;;;;;;;;;CAUC;AA6BM,SAAS,yCAAkB,KAA8B;IAC9D,IAAI,WAAC,OAAO,EAAE,cAAc,SAAS,EAAC,GAAG;IACzC,IAAI,YAAY,CAAA,GAAA,YAAI;IAEpB,OAAO;QACL,WAAW;YACT,MAAM;QACR;QACA,cAAc,UAAU;YACtB,kEAAkE;YAClE,4EAA4E;YAC5E,0DAA0D;YAC1D,IAAI;YACJ,MAAM;YACN,aAAa,CAAC;gBACZ,uEAAuE;gBACvE,EAAE,cAAc;YAClB;QACF,IAAI,CAAC;QACL,YAAY;YACV,MAAM;YACN,cAAc;YACd,mBAAmB,UAAU,YAAY;QAC3C;IACF;AACF","sources":["packages/@react-aria/listbox/src/useListBoxSection.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {DOMAttributes} from '@react-types/shared';\nimport {ReactNode} from 'react';\nimport {useId} from '@react-aria/utils';\n\nexport interface AriaListBoxSectionProps {\n /** The heading for the section. */\n heading?: ReactNode,\n /** An accessibility label for the section. Required if `heading` is not present. */\n 'aria-label'?: string\n}\n\nexport interface ListBoxSectionAria {\n /** Props for the wrapper list item. */\n itemProps: DOMAttributes,\n\n /** Props for the heading element, if any. */\n headingProps: DOMAttributes,\n\n /** Props for the group element. */\n groupProps: DOMAttributes\n}\n\n/**\n * Provides the behavior and accessibility implementation for a section in a listbox.\n * See `useListBox` for more details about listboxes.\n * @param props - Props for the section.\n */\nexport function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectionAria {\n let {heading, 'aria-label': ariaLabel} = props;\n let headingId = useId();\n\n return {\n itemProps: {\n role: 'presentation'\n },\n headingProps: heading ? {\n // Technically, listbox cannot contain headings according to ARIA.\n // We hide the heading from assistive technology, using role=\"presentation\",\n // and only use it as a visual label for the nested group.\n id: headingId,\n role: 'presentation',\n onMouseDown: (e) => {\n // Prevent DOM focus from moving on mouse down when using virtual focus\n e.preventDefault();\n }\n } : {},\n groupProps: {\n role: 'group',\n 'aria-label': ariaLabel,\n 'aria-labelledby': heading ? headingId : undefined\n }\n };\n}\n"],"names":[],"version":3,"file":"useListBoxSection.module.js.map"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@react-aria/listbox",
3
- "version": "3.15.0",
3
+ "version": "3.15.2",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -26,14 +26,14 @@
26
26
  "url": "https://github.com/adobe/react-spectrum"
27
27
  },
28
28
  "dependencies": {
29
- "@react-aria/interactions": "^3.25.6",
30
- "@react-aria/label": "^3.7.22",
31
- "@react-aria/selection": "^3.26.0",
32
- "@react-aria/utils": "^3.31.0",
33
- "@react-stately/collections": "^3.12.8",
34
- "@react-stately/list": "^3.13.1",
35
- "@react-types/listbox": "^3.7.4",
36
- "@react-types/shared": "^3.32.1",
29
+ "@react-aria/interactions": "^3.27.0",
30
+ "@react-aria/label": "^3.7.24",
31
+ "@react-aria/selection": "^3.27.1",
32
+ "@react-aria/utils": "^3.33.0",
33
+ "@react-stately/collections": "^3.12.9",
34
+ "@react-stately/list": "^3.13.3",
35
+ "@react-types/listbox": "^3.7.5",
36
+ "@react-types/shared": "^3.33.0",
37
37
  "@swc/helpers": "^0.5.0"
38
38
  },
39
39
  "peerDependencies": {
@@ -43,5 +43,5 @@
43
43
  "publishConfig": {
44
44
  "access": "public"
45
45
  },
46
- "gitHead": "0bda51183baa23306342af32a82012ea0fe0f2dc"
46
+ "gitHead": "66e51757606b43a89ed02c574ca24517323a2ab9"
47
47
  }
@@ -46,11 +46,15 @@ export function useListBoxSection(props: AriaListBoxSectionProps): ListBoxSectio
46
46
  role: 'presentation'
47
47
  },
48
48
  headingProps: heading ? {
49
- // Techincally, listbox cannot contain headings according to ARIA.
49
+ // Technically, listbox cannot contain headings according to ARIA.
50
50
  // We hide the heading from assistive technology, using role="presentation",
51
51
  // and only use it as a visual label for the nested group.
52
52
  id: headingId,
53
- role: 'presentation'
53
+ role: 'presentation',
54
+ onMouseDown: (e) => {
55
+ // Prevent DOM focus from moving on mouse down when using virtual focus
56
+ e.preventDefault();
57
+ }
54
58
  } : {},
55
59
  groupProps: {
56
60
  role: 'group',