Comments (1)
I did some digging, and it looks like the root cause of this is the fact that useContextProps()
will merge contextProps
and props
only when both of them are of type object
:
react-spectrum/packages/react-aria-components/src/utils.tsx
Lines 193 to 204 in a597a0c
Since the above condition is not met when a user provides their style as a function, it resorts to the default merging strategy of mergeProps(contextProps, props)
, which is to select the value of the last argument (in our case, props
over contextProps
:
react-spectrum/packages/@react-aria/utils/src/mergeProps.ts
Lines 68 to 70 in a597a0c
So that's why the contextProps
passed by Combobox
that contains style: {'--trigger-width': menuWidth}
is overwritten by the user provided style={() => ({ background: "red" })}
.
from react-spectrum.
Related Issues (20)
- useLongPress always disables user-select HOT 3
- Dates within DatePicker `validationErrors` are not correctly localised on server when using a different language HOT 3
- Combobox Input requires hitting enter twice to submit a form HOT 3
- CheckboxGroup with more than one Text component that has unique id-props set causes an infinite React re-render loop HOT 2
- DropZone unexpectedly submits forms. HOT 2
- When multiple tooltips are open controlled, the first tooltip would not close after the cursor hovers on the second tooltip. HOT 1
- [@react-aria/live-announcer] "Uncaught Error: document is not defined" when used in render function in SSR HOT 1
- Event Bubbling Issue with Radio Component in Form Navigation HOT 4
- Yarn pnp error when loading @spectrum-icons: Could not resolve "@babel/runtime/helpers/extends" HOT 1
- ComboBox list items not scrolling HOT 9
- Support server-side rendering components with defaultOpen={true}
- addPerson defined but not used in example
- [react-aria-componets]: Checkbox imposible to visit links defined in Label HOT 6
- Popover closing after scroll in safari HOT 1
- Down / up arrow key navigation not working in Select component when VoiceOver enabled HOT 3
- @internationalization/date has two identical (?) module exports (also publint complains) HOT 1
- Allow dateFields to have different formats HOT 7
- onClick cannot be triggered using continuePropagation HOT 3
- React Aria Starter Kit download (for Tailwind) is out of date with latest react-aria-components version HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-spectrum.