Comments (3)
Related Semantic-Org/Semantic-UI#348
from semantic-ui-ember.
Yes, they are. We have a blind customer that cannot complete their tasks due to the dropdown not responding to same keyboard events that a "select" normally does. It receives the focus on tab and the reader reads the option text, however, using arrow keys doesn't move the focus from "option" to "option" (really divs) and hitting Enter on the keyboard, of course, then doesn't select the item the blind user would like to select. Any workarounds or plans to address this?
from semantic-ui-ember.
@rachael-ross We obviously needed some solution to this, and I came up with a workaround. It's not perfect, but it works with my testing.
I came up with a tweak function we use in an input wrapper component (it can also render other inputs).
dropdownAriaTweaks (type) {
let $dropdown = this.$('.ui.dropdown');
if (type === 'init') {
$dropdown.attr({
'aria-haspopup': 'listbox',
'aria-labelledby': `${this.get('inputId')}__text ${this.get('inputId')}__label`,
role: 'button'
});
} else if (type === 'show') {
setTimeout(() => {
$dropdown.attr('aria-expanded', true);
let $menu = this.$('ul[role="listbox"]')[0];
console.log('focusing ', $menu);
this.set('adtIsFocusing', true);
$menu.focus();
}, 300);
if (this.get('adtIsFocusing')) {
this.set('adtIsFocusing', false);
return false;
}
} else if (type === 'hide') {
if (this.get('adtIsFocusing')) {
this.set('adtIsFocusing', false);
return false;
}
setTimeout(() => {
$dropdown.attr('aria-expanded', false);
let $focused = document.activeElement || {};
let totalFocusLoss = $focused.id && !this.$(`#${$focused.id}`)[0];
if (!this.get('adtIsFocusing') && !totalFocusLoss) {
this.set('adtIsFocusing', true);
$dropdown.focus();
}
}, 300);
}
}
Our dropdown usage looks like this. Please note this is highly tailored to our usage.
I hope this helps.
EDIT: Forgot to mention we call the init tweak portion of that function in didReceiveAttrs
:
didReceiveAttrs () {
scheduleOnce('afterRender', () => this.dropdownAriaTweaks('init'));
}
from semantic-ui-ember.
Related Issues (20)
- Wrong documenation
- Semantic UI themeing doesn't work HOT 4
- Yarn support? (support silent npm install of Semantic-UI?) HOT 2
- Yarn workspaces compatibility
- Accordion - no such method 'internal' for accordion widget instance
- How to setup theming correctly HOT 1
- Guidelines and TODO HOT 4
- Make a release with addon configuration bugfix to enable themeing HOT 2
- Add support for features released in semantic UI 2.4 HOT 2
- Ember 3.9 DEPRECATION: Using this.$() in a component has been deprecated, consider using this.element [deprecation id: ember-views.curly-components.jquery-element] HOT 9
- Support for fomantic-ui
- Publish a new release HOT 8
- Abandoned Framework/Add-On ? HOT 8
- bug: broken image in README
- Unable to find jQuery Semantic UI module: modal HOT 2
- Unknown feature "default-async-observers" found in config/optional-features.json HOT 13
- Unable to find jQuery Semantic UI module: dropdown
- [question] Support for Ember Octane?
- Any plan to support Fomantic versions and Ember 4-5?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from semantic-ui-ember.