This issue has been created
 
 
XWiki Platform / cid:jira-generated-image-avatar-95495de2-da99-4d38-92d3-6f7946e1f960 XWIKI-25648 Open

Only initialize the suggest pickers on input and select elements

 
View issue   ยท   Add comment
 

Issue created

 
cid:jira-generated-image-avatar-1fdadb79-9be7-49ed-b1d4-490bac9eacd3 Charpentier Lucas created this issue on 04/Nov/26 13:23
 
Summary: Only initialize the suggest pickers on input and select elements
Issue Type: cid:jira-generated-image-avatar-95495de2-da99-4d38-92d3-6f7946e1f960 Improvement
Affects Versions: 17.10.14
Assignee: Unassigned
Components: Web - Templates & Resources
Created: 04/Nov/26 13:23
Priority: cid:jira-generated-image-static-major-5402df64-2fc4-4ee7-b9ee-4d3e0498b857 Major
Reporter: Charpentier Lucas
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.