layout | tags |
---|---|
doc-api.html |
browser-fix, service, argument-options |
This Browser Bug Workaround targets an issue in old Blink and WebKit causing focus (by MouseEvent
and TouchEvent
) to be given to the next parent element accepting focus, rather than the element the event was dispatched to.
Considering the following markup, clicking on the <a>
element would focus the <div>
instead:
<div tabindex="-1">
<a href="http://example.org/">Hello World</a>
</div>
// engage the workaround for the entire document
var handle = ally.fix.pointerFocusParent();
// disengage the workaround
handle.disengage();
// engage the workaround only for a sub-tree
var handle = ally.fix.pointerFocusParent({
context: '#element-to-fix',
});
Name | Type | Default | Description |
---|---|---|---|
context | <selector> |
document |
The scope of the DOM in which to apply the fix. All elements of the collections are used. |
A <service>
interface, providing the handle.disengage()
method to stop the service.
- EXAMPLE:
ally.fix.pointerFocusParent
Example
- NOTE: Only engaged for WebKit (detected via via platform.js).