CDLUC3 / dmptool

DMPTool version of the DMPRoadmap codebase
https://dmptool.org
MIT License
56 stars 13 forks source link

Remove user-entered value from the typeahead dropdown #585

Open jupiter007 opened 1 month ago

jupiter007 commented 1 month ago

Currently, the typeahead controller adds the user-entered value as the top entry in the dropdown (see attached movie below).

We believe users may be selecting that option from the dropdown, thinking it's an existing match for their entry, rather than it just reflecting what they just entered. This functionality may be adding to duplicate entries as well.

Another bug that was observed is that the helper text/microtext below the "Repository URL" field displays, even when that field is hidden.

To Reproduce Steps to reproduce the behavior:

  1. Go to https://dmptool-stg.cdlib.org/
  2. Select "Upload Plan" from top nav
  3. Either add a new plan, or select "Update" for an existing plan
  4. Click on "Research Outputs" and click the blue "Add Output" button
  5. Enter a non-existent repository name in the "Repository Name" field
  6. Observe that the entry is now the first entry in the dropdown
  7. When you select a legitimate value from the dropdown field, you will notice that the "Repository URL" field disappears, but that the helper text for the field still displays.

Expected behavior The user-entered value should not be added to the dropdown selection

Screenshots Below is a movie displaying the functionality described above.

https://github.com/CDLUC3/dmptool/assets/8452761/34d85256-a0bc-44cc-834b-42f7ec3b3590

jupiter007 commented 1 month ago

@magicalmary we added this ticket to remove the user-entered value from the dropdown and to fix the issue with the Repository URL helper text displaying, even when the field is hidden.

As part of a separate ticket, #580 , I have created a typeahead component that forces users to make a selection from the dropdown, or select "Other" to enter a different name. I attached a movie to that ticket showing how it works. I want to run it by you at our next stand up to see what you think before I commit anything to git.