Skip to content
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

Merged
merged 4 commits into from
Sep 27, 2024

Conversation

mbarrramsey
Copy link
Contributor

@mbarrramsey mbarrramsey commented Sep 26, 2024

Description

  • Fixes WB-NNNNN
  • Fixes #NNNN

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?

@mbarrramsey mbarrramsey changed the title add width to autocomplete chore(weave): add width to autocomplete Sep 26, 2024
@circle-job-mirror
Copy link

circle-job-mirror bot commented Sep 26, 2024

@mbarrramsey mbarrramsey marked this pull request as ready for review September 26, 2024 22:46
@mbarrramsey mbarrramsey requested review from a team as code owners September 26, 2024 22:46
hasInputValue?: boolean;
inputRef?: React.MutableRefObject<HTMLDivElement | null>;
Copy link
Contributor

@connieelee connieelee Sep 26, 2024

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe inputDivRef? or autocompleteDivRef?

Copy link
Contributor

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()?

Copy link
Contributor Author

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?

Copy link
Contributor

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!

@mbarrramsey mbarrramsey force-pushed the mbarrramsey/add_ref_autocomplete branch from e395283 to 109d047 Compare September 26, 2024 23:52
@mbarrramsey mbarrramsey merged commit dba93b7 into master Sep 27, 2024
73 checks passed
@mbarrramsey mbarrramsey deleted the mbarrramsey/add_ref_autocomplete branch September 27, 2024 18:04
@github-actions github-actions bot locked and limited conversation to collaborators Sep 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants