Skip to content

ComboBox Form context inheritance issue with label props #2323

@ktabors

Description

@ktabors

🐛 Bug Report

Side label end doesn't position correctly. Root cause is form context isn't being set in ComboBox, i.e useFormProps.

🤔 Expected Behavior

ComoBox inherits all the props from a From.

😯 Current Behavior

The context isn't being passed correctly to ComboBox so label aren't being positioned correctly.

💁 Possible Solution

Adding Form context, useFormProps, to ComboBox or refactoring Form context to be in Field.tsx so the individual components don't have each inherit. https://github.com/adobe/react-spectrum/search?q=useFormProps

🔦 Context

This was noticed in a Form with only comboboxes.

💻 Code Sample

https://codesandbox.io/s/heuristic-pascal-i1hmy
https://codesandbox.io/s/vibrant-driscoll-c6697?file=/src/App.tsx:199-1287

🌍 Your Environment

Software Version(s)
react-spectrum 3.12.x and 3.13.x

🧢 Your Company/Team

RSP

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions