Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(aria-input-field-name): skip combobox popups #3886

Merged
merged 7 commits into from
Jan 31, 2023

Conversation

WilcoFiers
Copy link
Contributor

Closes: #3860

@@ -3,7 +3,7 @@ import getImplicitRole from './implicit-role';
import getGlobalAriaAttrs from '../standards/get-global-aria-attrs';
import isFocusable from '../dom/is-focusable';
import { getNodeFromTree } from '../../core/utils';
import AbstractVirtuaNode from '../../core/base/virtual-node/abstract-virtual-node';
import AbstractVirtualNode from '../../core/base/virtual-node/abstract-virtual-node';
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Found a typo


const isCombobox = node => node && getRole(node) === 'combobox';

function nearestParentWithRole(vNode) {
Copy link
Contributor Author

@WilcoFiers WilcoFiers Jan 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were using closest before, but this is more accurate and faster. It's not perfect though. We should really have a method that can tell you the owner. I spent more time on this PR than I expected to already, and didn't want to bloat this further. I opened a tech debt ticket: #3888

}

if (!virtualNode.actualNode) {
throw new Error('Unable to determine combobox popup without an actualNode');
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't think we needed additional virtualNode tests, but let me know if I missed anything.

@WilcoFiers WilcoFiers marked this pull request as ready for review January 25, 2023 11:49
@WilcoFiers WilcoFiers requested a review from a team as a code owner January 25, 2023 11:49
lib/rules/no-naming-method-matches.js Outdated Show resolved Hide resolved
lib/commons/aria/is-combobox-popup.js Outdated Show resolved Hide resolved
lib/commons/aria/is-combobox-popup.js Show resolved Hide resolved
test/rule-matches/no-naming-method-matches.js Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Listbox should not require a name when its used in a combobox pattern
2 participants