-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix #1808 JAWS reading dialog title when closing dropdown widget
This commit contains a better fix for the problem described in #1797. When a dropdown widget with waiAria:true is inside a dialog with role=dialog the dropdown DOM element is no longer appended to the <body> but to the element that has role=dialog. Therefore, screen readers correctly understand that the dropdown is not outside the dialog and no longer read the dialog title when changing the focus after closing the dropdown. PTR 14068536
- Loading branch information
Showing
6 changed files
with
76 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
/* | ||
* Copyright 2015 Amadeus s.a.s. | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
var Aria = require("ariatemplates/Aria"); | ||
var DomUtils = require("../../utils/Dom"); | ||
var Viewport = require("./Viewport"); | ||
|
||
module.exports = Aria.classDefinition({ | ||
$classpath : "aria.popups.container.ViewportElement", | ||
$extends : require("./DomElement"), | ||
$constructor : function (parentContainer) { | ||
this.parentContainer = parentContainer; | ||
var childContainer = parentContainer.ownerDocument.createElement("div"); | ||
childContainer.style.position = "absolute"; | ||
parentContainer.appendChild(childContainer); | ||
this.$DomElement.$constructor.call(this, childContainer); | ||
this._updateChildPosition(); | ||
}, | ||
$destructor : function () { | ||
this.parentContainer.removeChild(this.container); | ||
this.parentContainer = null; | ||
this.$DomElement.$destructor.call(this); | ||
}, | ||
$prototype : { | ||
_updateChildPosition : function () { | ||
var viewportSize = Viewport.getClientSize(); | ||
var parentPosition = DomUtils.calculatePosition(this.parentContainer); | ||
var containerStyle = this.container.style; | ||
containerStyle.left = (-parentPosition.left) + "px"; | ||
containerStyle.top = (-parentPosition.top) + "px"; | ||
containerStyle.width = viewportSize.width + "px"; | ||
containerStyle.height = viewportSize.height + "px"; | ||
}, | ||
|
||
_getGeometry : function () { | ||
this._updateChildPosition(); | ||
return this.$DomElement._getGeometry.call(this); | ||
} | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters