Uploaded image for project: 'Cristal'
  1. Cristal
  2. CRISTAL-875

Support select items with a value distinct from their label

    XMLWordPrintable

Details

    • Unknown

    Description

      The XSelect component of the design system only supports items that are plain strings, used both as the value and as the displayed label of the option. This doesn't work when the displayed label is not a suitable value, e.g. when it is localized (it changes with the locale), when it is loaded asynchronously, or when several items can have the same label.

      XWIKI-23927 changes the XSelect API (@xwiki/platform-dsapi) so that an item can also be an object with distinct value and label properties (the new SelectItem type). The link modal's link type selector uses it, identifying each link type by its type while displaying its localized label.

      The Shoelace and Vuetify implementations of XSelect need to support these items, otherwise they display "[object Object]" instead of the label in the link type selector.

      Attachments

        Issue Links

          Activity

            People

              mflorea Marius Dumitru Florea
              mflorea Marius Dumitru Florea
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: