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

fix: <Select/> when !multiple || !box #1613

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Commits on Aug 16, 2023

  1. fix: <Select/> when !multiple || !box`

    When the props `multiple` and `box` are defined, `downed` is being
    set through eventListeners set on the window inside an effect.
    If they are not set, `downed` before this commit was never set,
    which caused `onChange` to never run.
    
    To solve this bug I add a condition `shouldDragSelect = multiple && box`
    a conditional event-listeners on `<group/>` in case `!shouldDragSelect`
    so that when `shouldDragSelect` `down` is being set through the
    event-listeners set inside the effect, and if `!shouldDragSelect` it
    is being set whenever one of Select's children is being clicked.
    bigmistqke committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    4878dc8 View commit details
    Browse the repository at this point in the history
  2. fix: add shouldDragSelect to dependencies

    Before commit the effect relying on `shouldDragSelect` did not include it in its dependencies.
    Neither did the code before this branch, so I am unsure if this was a conscious act or not,
    but I believe it could cause a bug where one of the props is changed but event-listeners are not properly cleaned up.
    
    besides this I return `undefined` instead of `null` in case `shouldDragSelect` in `<group/>` event-listeners
    bigmistqke committed Aug 16, 2023
    Configuration menu
    Copy the full SHA
    4839f66 View commit details
    Browse the repository at this point in the history