Bug #14346
closedDo not scroll on WSuggestionPopup selection
0%
Description
When a WSuggestionPopup selection occurs, a href="#" is activated.
This is the effect of changes due to CSP, and a fix coming from this change.
Here, the javascript:void(0); call that occurred on many elements was replaced with #. This to ensure that the items are still keyboard selectable (and thus boost accessibility), while also avoiding inline JavaScript, which is prohibited by the CSP rules applied by default.
To this end the Wt-no-default was introduced. However, for a WSuggestionPopup specifically, this does not work. As the selection occurs on a parent of the anchor. The structure is <ul><li><a><span>, with the selection happening on <li>.
This means the anchors's Wt-no-default will NOT be taken into account, as the anchor does not receive its own click handler.
So a selection occurs, and the WSuggestionPopup will scroll the page to the top, possibly making the widget scroll out of view.
Updated by Matthias Van Ceulebroeck 2 days ago
- Status changed from InProgress to Review
- Assignee deleted (
Matthias Van Ceulebroeck)
Updated by Romain Mardulyn 2 days ago
- Target version changed from 4.12.4 to 4.12.3
Updated by Romain Mardulyn 2 days ago
- Status changed from Review to Implemented @Emweb
- Assignee changed from Romain Mardulyn to Matthias Van Ceulebroeck
Updated by Romain Mardulyn about 24 hours ago
- Status changed from Implemented @Emweb to Closed