From 56c30b91daa67ecf6410d613f515ddecdbba6cdf Mon Sep 17 00:00:00 2001 From: LucasC Date: Mon, 5 May 2025 17:00:19 +0200 Subject: [PATCH 1/2] XWIKI-23097: Quicksearch: no alert when results are shown * Added the alert role to the container of suggestions. --- .../webapp/resources/uicomponents/suggest/suggest.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/suggest/suggest.js b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/suggest/suggest.js index e1bccdc608b8..ccb59e257d3c 100644 --- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/suggest/suggest.js +++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/suggest/suggest.js @@ -494,8 +494,14 @@ var XWiki = (function(XWiki){ if (!$(this.options.parentContainer).down('.suggestItems')) { // If the suggestion top container is not in the DOM already, we create it and inject it - - var div = new Element("div", { 'class': "suggestItems "+ this.options.className }); + + // We populate the suggestion container with information that was not on the page. + // This meaningful change in the DOM must be announced + // so that assistive technology users can notice it without trouble. + var div = new Element("div", { + 'class': "suggestItems "+ this.options.className , + 'role': 'alert' + }); // Get position of target textfield var pos = $(this.options.parentContainer).tagName.toLowerCase() == 'body' ? this.fld.cumulativeOffset() : this.fld.positionedOffset(); From 0a077ac3a3e8dfd5549253f83002fb679af1f89c Mon Sep 17 00:00:00 2001 From: LucasC Date: Mon, 5 May 2025 17:00:39 +0200 Subject: [PATCH 2/2] XWIKI-23097: Quicksearch: no alert when results are shown * Fixed codestyle --- .../src/main/webapp/resources/uicomponents/suggest/suggest.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/suggest/suggest.js b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/suggest/suggest.js index ccb59e257d3c..d674c529849d 100644 --- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/suggest/suggest.js +++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-war/src/main/webapp/resources/uicomponents/suggest/suggest.js @@ -499,7 +499,7 @@ var XWiki = (function(XWiki){ // This meaningful change in the DOM must be announced // so that assistive technology users can notice it without trouble. var div = new Element("div", { - 'class': "suggestItems "+ this.options.className , + 'class': "suggestItems "+ this.options.className, 'role': 'alert' });