infor-design / enterprise-wc

Enterprise-grade web component library for the Infor Design System
Apache License 2.0
27 stars 24 forks source link

IdsInput: Autocomplete with dynamic data sometimes displays unformatted data #2545

Open rokusasu13 opened 1 month ago

rokusasu13 commented 1 month ago

Describe the Issue I am using a web service to supply the autocomplete.data when the user types a key and the pop-up sometimes display unformatted data. I added screenshots below for comparison. Also are there plans to add the source attribute or something similar for dynamic data?

To Reproduce Steps to see the question or problem:

  1. Create an ids-input with autocomplete
  2. Add an input event that calls a web service to set autocomplete data
  3. Type different keywords in the ids-input field to test the web service
  4. The pop-up shows the autocomplete data
  5. Sometimes the pop-up shows unformatted data (See screenshot below)

What are you trying to do The autocomplete data will be updated via web service whenever the ids-input field value changes.

What did you try so far Setting autocomplete.data to false before setting the new data then switching it back to true fixes the issue but the pop-up closes every time the user types a key.

Version

Screenshots image image

Platform

Additional Context Add any other context about the question or problem here, including the use case if relevant.

tmcconechy commented 1 month ago

@rokusasu13 can you make an example for this https://stackblitz.com/edit/ids-enterprise-wc-120?file=index.html Some the steps im not exactly sure what you did so might come out with a different outcome

rokusasu13 commented 1 month ago

I used the link above and copied the ids-input autocomplete example code but I keep getting this error after typing some characters.

Code:

      <ids-input
        id="input-autocomplete-2"
        placeholder="This input's label is visible"
        size="md"
        label="Autocomplete Input (states)"
        autocomplete
        search-field="label"
      >
      </ids-input>

Error occurred: this.alignTarget.getBoundingClientRect is not a function

Stackblitz: https://stackblitz.com/edit/ids-enterprise-wc-120-djvyz1?file=index.html