Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-25648

Only initialize the suggest pickers on input and select elements

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Major
    • None
    • 17.10.14
    • None
    • Unknown

    Description

      The suggest pickers are initialized on every element that has their CSS class, whatever the element is. For example, suggestPages.js calls suggestPages() on .suggest-pages, and the same goes for .suggest-spaces, .suggest-users, .suggest-groups, .suggest-attachments, .suggest-propertyValues, .suggest-childPages and .suggest-wikis.

      These class names are generic, so a page or an extension can use one of them on an element that is not a form field, for instance to style it. The picker then tries to turn that element into a selectize widget.

      The pickers should only be initialized on the form fields they can enhance, i.e. input and select elements having the class.

      This was raised in https://github.com/xwiki/xwiki-platform/pull/5999#discussion_r4442205172 about the new wiki picker, which follows the selector of the existing pickers.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              Lucas C Charpentier Lucas
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: