The current Combobox/Option ordering logic uses React.children, key, and Option.fluentComponentType. This requires Options to be direct children of Combobox or OptionGroup, and for anyone extending Option to also set NewComponent.fluentComponentType (similar to Spectrum's Collection helper).
We should investigate querying the DOM to order options instead, since it doesn't have React component hierarchy restrictions.
Ref:
areas to investigate:
- any implications for virtualization
- will there be any issues with reordering options, or any other types of DOM modifications that might affect this?
The current Combobox/Option ordering logic uses
React.children,key, andOption.fluentComponentType. This requires Options to be direct children of Combobox or OptionGroup, and for anyone extending Option to also setNewComponent.fluentComponentType(similar to Spectrum's Collection helper).We should investigate querying the DOM to order options instead, since it doesn't have React component hierarchy restrictions.
Ref:
compareDocumentPosition: https://codesandbox.io/s/practical-framework-ng2l3?file=/src/App.tsxactivedescendantdirectly withsetAttribute: https://codesandbox.io/s/staging-glitter-vmgsky?file=/src/App.tsxareas to investigate: