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

bug: When two gcds-selects are placed on the same page and accessing the same list of elements, one of the lists loses its list items/values and becomes empty. #684

Open
3 tasks done
dark-creaters opened this issue Nov 13, 2024 · 1 comment

Comments

@dark-creaters
Copy link

dark-creaters commented Nov 13, 2024

Prerequisites | Prérequis

GC Design System Components Package and Version | Paquet et version des composants de Système de design GC

0.22.0

Current Behavior | Comportement observé

When two gcds-selects are placed on the same page and accessing the same list of elements, one of the lists loses its list items/values and becomes empty.
To reproduce Demo

  1. Create two gcds-select fields with all the required properties/attributes
  2. Populate the two gcd-selects with the same list of items
  3. Now, launch the app and navigate to the page containing these two selects
  4. Try to select an item in the first select option, notice that the list of items in the first select is empty. However, the second select option still has its list values. Also, after some number of attempts the first select option may regain its values

Note:
The issue becomes more noticeable when the throttling option in DevTools is set to 3G mode. It is even more obvious when the page is quickly refreshed.

empty-select
working-normal-select

Expected Behavior | Comportement attendu

The content of the gcds-select should always maintain its list and should always be available for selection.

System Info | Information sur le système

Vue 3.4. Observed in Edge and chrome on Windows.

Steps to Reproduce | Étapes pour reproduire le bogue

To reproduce [Please review the stackblitz here](https://stackblitz.com/edit/dfo-gcds-vue-testrig-ajcamr?file=README.md)

  1. Create two gcds-select fields with all the required properties/attributes
  2. Populate the two gcd-selects with the same list of items
  3. Now, launch the app and navigate to the page containing these two selects
  4. Try to select an item in the first select option, notice that the list of items in the first select is empty. However, the second select option still has its list values. Also, after some number of attempts the first select option may regain its values

Code Reproduction URL | URL de reproduction du code

https://stackblitz.com/edit/dfo-gcds-vue-testrig-ajcamr?file=README.md

Additional Information | Informations supplémentaires

Thanks a lot for the great work!

@theonlyguills
Copy link

theonlyguills commented Nov 13, 2024

Hey,

I would like to add, it's not adding 2 gcds-select it's just the fact that it's somehow not reactive to the data being loaded. Adding a v-if="isDataLoaded" to the gcds-select and setting that to true when the data is done loading will make it behave as expected.

In the stackblitz above if you just keep refreshing the page you will encounter it at times, more often if you throttle down to 3G.

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

No branches or pull requests

2 participants