gcds-components icon indicating copy to clipboard operation
gcds-components copied to clipboard

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.

Open dark-creaters opened this issue 1 year ago • 2 comments

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!

dark-creaters avatar Nov 13 '24 13:11 dark-creaters

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.

theonlyguills avatar Nov 13 '24 14:11 theonlyguills

Check after Setncil update if this is fixed.

adorayi avatar May 28 '25 16:05 adorayi