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: clear dropdown on unmount #114

Merged

Conversation

soleh45
Copy link
Contributor

@soleh45 soleh45 commented Mar 4, 2024

#112
when the user opens the content dropdown then the user immediately unmounts the component, the content is not reset so an error occurs, because the content is not reset and is on another thread

…ly unmounts the component, the content is not reset so an error occurs, because the content is not reset and is on another thread
@soleh45 soleh45 changed the title fix: when the user opens the content dropdown then the user immediate… fix: when the user opens the content dropdown then the user immediately unmounts the component, the content is not reset so an error occurs, because the content is not reset and is on another thread Mar 4, 2024
@soleh45
Copy link
Contributor Author

soleh45 commented Mar 5, 2024

please review my PR @onmotion

@onmotion
Copy link
Owner

onmotion commented Mar 5, 2024

Hi @soleh45 what kind of error occurs to you? What the steps to reproduce it?

@soleh45
Copy link
Contributor Author

soleh45 commented Mar 5, 2024

Hello @onmotion , here's how to track the problem

Step reproduce

  1. I render the Autocomplete Dropdown component

  2. Then I opened the dropdown until the options appeared in the dropdown

  3. I navigate pages / open other pages without selecting the dropdown

  4. Then I clicked on the area where the selection dropdown appeared

  5. When you click on the content in AutocompleteDropdown it is not deleted when the component is unmounted, so the application crashes

attachment

  • condition when Autocomplete Dropdown content is not cleared when component unmount
Screenshot 2024-03-05 at 19 51 24 Screenshot 2024-03-05 at 19 52 12
  • conditions when Autocomplete Dropdown content is cleared when the component is unmounted
Screenshot 2024-03-05 at 19 54 30

@onmotion onmotion self-requested a review March 17, 2024 16:19
@onmotion onmotion changed the title fix: when the user opens the content dropdown then the user immediately unmounts the component, the content is not reset so an error occurs, because the content is not reset and is on another thread fix: clear dropdown on unmount Mar 17, 2024
@onmotion onmotion merged commit 469339b into onmotion:main Mar 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants