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

The onChange() function of the <Select/> component desynchronizes with the active state. #1980

Closed
cincolunes opened this issue Jun 4, 2024 · 2 comments
Labels
bug Something isn't working Stale Inactive issue

Comments

@cincolunes
Copy link

cincolunes commented Jun 4, 2024

  • three version: 0.151.0
  • @react-three/fiber version: 8.0.8
  • @react-three/drei version: 9.106.0
  • node version: 20.12.2
  • npm (or yarn) version: 10.5.0

Problem description:

The onChange() function of the Select component currently returns the previous value of the active state when multiple items are selected, and nothing when a single item is selected, due to the downed state interrupting its execution.

Relevant code:

  React.useEffect(() => {
    if (downed) onChange?.(active)
    else onChangePointerUp?.(active)
  }, [active, downed])

Suggested solution:

  React.useEffect(() => {
    if (!downed) onChange?.(active)
    else onChangePointerUp?.(active)
  }, [active, downed])

I'm going to provide a PR with this one.

@cincolunes cincolunes added the bug Something isn't working label Jun 4, 2024
@cincolunes cincolunes changed the title <Select/> onChange() function de-synchronizes with the active state inside. The onChange() function of the <Select/> component desynchronizes with the active state. Jun 4, 2024
Copy link

Thank you for contributing! We’re marking this issue as stale as a gentle reminder to revisit it and give it the attention it needs to move forward.

Any activity, like adding an update or comment, will automatically remove the stale label so it stays on our radar.

Feel free to reach out on Discord if you need support or feedback from the community. This issue will close automatically soon if there’s no further activity. Thank you for understanding and for being part of the project!

@github-actions github-actions bot added the Stale Inactive issue label Oct 30, 2024
Copy link

github-actions bot commented Nov 7, 2024

We’re closing this issue to keep our project manageable and make room for other active work, but we truly appreciate your effort and contribution.

If you’d like to continue working on this, please feel free to re-open it or reach out on Discord — our community is always ready to support you. Thanks again for helping us stay organized and for understanding our approach!

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Stale Inactive issue
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant