Skip to content

[Bug]: freeform Combobox lacks equivalent callback for native change event #29494

@YuanboXue-Amber

Description

@YuanboXue-Amber

Library

React Components / v9 (@fluentui/react-components)

System Info

v9.34.2

Are you reporting Accessibility issue?

None

Reproduction

see link of codesandbox in bug description

Bug Description

Actual Behavior

Native input has change event that fires on focus lose or Enter key. V8 Combobox has onChange callback that fires on the same cases. But there's no equivalent in v9 Combobox.

In this codesandbox with v8 and native input: https://codesandbox.io/s/sleepy-glitter-4rp64r?file=/src/index.tsx

  • type 'abc' in v8 Combobox, click on the body, notice console log shows onChange has been fired with value='abc'.
  • type 'abc' in native input, click on the body, notice console log shows native change event has been fired.

But in v9 there's no equivalent callback. onOptionSelect/ onChange is not firing on focus lose: https://codesandbox.io/s/elated-gianmarco-rtm868?file=/example.tsx

Expected Behavior

Freeform combobox should have a callback that is equivalent to native change event that fires on focus lose or on Enter key.
It is not so straightforward to achieve this from user override.

Logs

No response

Requested priority

High

Reason for piority

I encountered this when using v9 Combobox to create TimePicker compat. It is achievable via recomposing (therefore not blocking piority). However I wonder if v9 Combobox intentionally omit this. If not it would be better to fix it on combobox, and if so what's the reason.

Products/sites affected

No response

Are you willing to submit a PR to fix?

no

Validations

  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • The provided reproduction is a minimal reproducible example of the bug.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions