Project

General

Profile

Actions

Bug #14346

closed

Do not scroll on WSuggestionPopup selection

Added by Matthias Van Ceulebroeck 2 days ago. Updated about 24 hours ago.

Status:
Closed
Priority:
Normal
Target version:
Start date:
02/19/2026
Due date:
% Done:

0%

Estimated time:

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.

Actions #1

Updated by Matthias Van Ceulebroeck 2 days ago

  • Status changed from InProgress to Review
  • Assignee deleted (Matthias Van Ceulebroeck)
Actions #2

Updated by Romain Mardulyn 2 days ago

  • Target version set to 4.12.4
Actions #3

Updated by Romain Mardulyn 2 days ago

  • Assignee set to Romain Mardulyn
Actions #4

Updated by Romain Mardulyn 2 days ago

  • Target version changed from 4.12.4 to 4.12.3
Actions #5

Updated by Romain Mardulyn 2 days ago

  • Status changed from Review to Implemented @Emweb
  • Assignee changed from Romain Mardulyn to Matthias Van Ceulebroeck
Actions #6

Updated by Romain Mardulyn about 24 hours ago

  • Status changed from Implemented @Emweb to Closed
Actions

Also available in: Atom PDF