Comments (5)
Definitely strange, I don't see anything particularly different between the Group and the Input/Button elements that would cause this difference in behavior, will need to dig into what in useOverlayPosition is causing this positioning.
from react-spectrum.
For now I'm using this workaround.
const groupRef = React.useRef<HTMLDivElement>(null);
const triggerRef = React.useRef<HTMLDivElement | null>(null);
React.useLayoutEffect(() => {
if (groupRef.current) {
triggerRef.current = groupRef.current;
}
}, []);
<ComboBox>
<Group ref={groupRef}>
...
</Group>
<Popover triggerRef={triggerRef}>
...
</Popover>
</ComboBox>
from react-spectrum.
Seems to have something to do with what runs on the server vs what runs on the client. I don't know enough about Remix, but does it work if you turn it into a client only component? (don't know if that exists in Remix)
From what I can tell though, this isn't something related to RAC
from react-spectrum.
@snowystinger Remix doesn't have server components. I tested also with Next.js that has server components and added 'use client' directive. It wouldn't work without it anyways, and the same issue is there too. Here's the link.
https://stackblitz.com/edit/stackblitz-starters-xjutyc?file=app%2FComboBox.tsx
As @LFDanLu mentioned, the strange thing is that it works fine when you set the trigger element as the Button for example. That's why it feels like a RAC issue.
from react-spectrum.
It's odd because Group
is even more simple than Button
, so I can't imagine why the ref is not defined once you get to that first effect.
I asked about the server vs client because I saw this https://remix.run/docs/en/main/discussion/server-vs-client#splitting-up-client-and-server-code
I don't know how their magic splitting works.
It's good that it happens in Next.js though, I think we can go back to suspecting RAC.
I thought maybe the order in which renders/refs/effects ran in children/siblings might be a culprit, but then I would expect this to affect non-SSR as well. I also would expect that adding a wrapper around Group would solve it, and that didn't do anything. So I think we can rule that out as well.
from react-spectrum.
Related Issues (20)
- Getting white space while scroll to the bottom of the combobox HOT 3
- Thoughts on Collection API consistency HOT 9
- Combobox crashes on ios 18 (childNodes is not supported) HOT 3
- Uncontrolled RAC TextField does not restore value on browser tab restoration
- Popover with `<input autoFocus/>` scrolls to bottom HOT 2
- Combobox popover disappears during scroll HOT 1
- `MergeProvider` HOT 3
- Holding Option/Alt does not allow selection of text inside Link HOT 3
- Not getting no items view in plain combobox component HOT 3
- Removing a Tag in a TagGroup with disabled Tags crashes the page HOT 2
- RAC Virtualizer content element should have `role="presentation"`
- Unable to drag and drop links HOT 1
- Extended IME support for `@internationalized/number` HOT 2
- Meter component: issues identified by Axe DevTools HOT 3
- Hope that Radio and Checkbox will support the Number type HOT 3
- ComboBox doesn't open when `onInputChange` updates items asynchronously HOT 1
- Last options not getting rendered in popover after selection in combobox HOT 4
- Getting Blank spaces in the middle of the popover while a try to navigate using key board up arrow and down arrow in combobox HOT 2
- The onAction handler is called twice when passed to MenuItem. HOT 1
- [internationalized/date] Add eachMonthOfInterval query
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.