a11y: improve search box

This commit is contained in:
Sören Weber 2024-04-04 17:49:28 +02:00
parent 8f135335f3
commit 2c8cf85ea1
No known key found for this signature in database
GPG key ID: BEC6D55545451B6D
5 changed files with 29 additions and 23 deletions

View file

@ -93,9 +93,10 @@ var autoComplete = (function(){
pageXOffset = window.pageXOffset || document.documentElement.scrollLeft;
pageYOffset = window.pageYOffset || document.documentElement.scrollTop;
}
that.sc.style.left = Math.round(rect.left + pageXOffset + o.offsetLeft - parentOffsetLeft) + 'px';
that.sc.style.top = Math.round(rect.bottom + pageYOffset + o.offsetTop - parentOffsetTop) + 'px';
that.sc.style.width = Math.round(rect.right - rect.left) + 'px'; // outerWidth
// Is this really the job of the tool or should it be defered to the user?
// that.sc.style.left = Math.round(rect.left + pageXOffset + o.offsetLeft - parentOffsetLeft) + 'px';
// that.sc.style.top = Math.round(rect.bottom + pageYOffset + o.offsetTop - parentOffsetTop) + 'px';
// that.sc.style.width = Math.round(rect.right - rect.left) + 'px'; // outerWidth
if (!resize) {
that.sc.style.display = 'block';
if (!that.sc.maxHeight) { that.sc.maxHeight = parseInt((window.getComputedStyle ? getComputedStyle(that.sc, null) : that.sc.currentStyle).maxHeight); }

View file

@ -271,7 +271,7 @@ function startSearch(){
var searchList = new autoComplete({
/* selector for the search box element */
selectorToInsert: '#R-header-wrapper',
selectorToInsert: 'search:has(.searchbox)',
selector: '#R-search-by',
/* source is the callback to perform the search */
source: function(term, response) {