-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(weave): add width to autocomplete #2500
Conversation
Preview this PR with FeatureBee: https://beta.wandb.ai/?betaVersion=ea392036e1d0254d80489d8695d6b2d023a32e3e |
hasInputValue?: boolean; | ||
inputRef?: React.MutableRefObject<HTMLDivElement | null>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggestion: inputRef
naming seems misleading if it's actually a div element under there? maybe should be named something else
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe inputDivRef
? or autocompleteDivRef
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should probably leave out "input" entirely. if you inspect the elements, there's an actual input
element nested inside, but this ref is definitely not being attached to that.
have you tried React.forwardRef()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did try the forwardRef, but I don't think it works well with generics 🤔 see https://github.com/wandb/core/pull/24247/files#r1777844929. We could try using the wrapper approach but it seems like the custom name is similar?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh i see. maybe something like containerRef
or autocompleteRef
seems fine then!
e395283
to
109d047
Compare
Description
Adds minWidth param and ref to the autocomplete component so we can measure the full width of the text input for use in https://github.com/wandb/core/pull/24247.
Testing
How was this PR tested?