Uploaded image for project: 'Nuxeo Elements'
  1. Nuxeo Elements
  2. ELEMENTS-916

nuxeo-selectivity behaves differently using the same selection and result formatter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.0
    • Fix Version/s: 3.0.0
    • Component/s: UI, Widgets
    • Tags:
    • Browser:
    • Sprint:
      NOS 11.1.6 - 2019-04 1, NOS 11.1.7 - 2019-04 2, NOS 11.1.8 - 2019-05 01
    • Story Points:
      0

      Description

      For the following usage of nuxeo-selectivity:

      <nuxeo-selectivity
        data="[[data]]"
        selection-formatter="[[selectionAndResultFormatter]]"
        result-formatter="[[selectionAndResultFormatter]]">
      

      With this data array property:

      data: {
        type: Array,
        value: [
          'icons:arrow-upward',
          'icons:arrow-downward',
          'icons:arrow-back',
          'icons:arrow-forward',
        ],
      },
      

      And this selectionAndResultFormatter function:

      selectionAndResultFormatter(item) {
        return `
          <iron-icon icon="${item}"></iron-icon>
          <span>${item}</span>
        `;
      },
      

      nuxeo-selectivity ends up displaying the selection result in the wrong place.

      In the attached video the behaviour is visible, as well as the CSS property (white-space: pre;) possibly causing the issue.

      As a workaround, the formatter can be written like:

      selectionAndResultFormatter(item) {
        return `<iron-icon icon="${item}"></iron-icon><span>${item}</span>`;
      },
      

      This will solve the issue visually, but it's not too helpful if the template is a bit more complex.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 day, 4 hours, 40 minutes
                  1d 4h 40m