-
Notifications
You must be signed in to change notification settings - Fork 138
fix(core/dropdown-button): accessibility consistency in dropdown-button-icon #2654
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
base: main
Are you sure you want to change the base?
Changes from all commits
6bef1f8
3735a7c
40a0a1a
1e06d47
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,6 +1,6 @@ | ||
| { | ||
| "compilerOptions": { | ||
| "target": "ES2017", | ||
| "target": "ES2020", | ||
| "lib": [ | ||
| "dom", | ||
| "dom.iterable", | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -30,10 +30,10 @@ | |
| * and then check if it is not undefined for Vue >= 3.1.0. | ||
| * See https://github.com/vuejs/vue-next/issues/3889 | ||
| */ | ||
| const EMPTY_PROP = Symbol(); | ||
| const EMPTY_PROP = {}; | ||
| const DEFAULT_EMPTY_PROP = { default: EMPTY_PROP }; | ||
|
|
||
| interface NavManager<T = any> { | ||
| navigate: (options: T) => void; | ||
| } | ||
|
|
||
|
|
@@ -65,7 +65,7 @@ | |
| */ | ||
| export const defineContainer = <Props, VModelType = string | number | boolean>( | ||
| name: string, | ||
| defineCustomElement: any, | ||
| componentProps: string[] = [], | ||
| modelProp?: string, | ||
| modelUpdateEvent?: string | ||
|
|
@@ -112,7 +112,7 @@ | |
| * when ionChange bubbles up from Component B. | ||
| */ | ||
| if (e.target.tagName === el.tagName) { | ||
| modelPropValue = (e?.target as any)[modelProp]; | ||
| emit(UPDATE_VALUE_EVENT, modelPropValue); | ||
| } | ||
| }); | ||
|
|
@@ -130,7 +130,7 @@ | |
| if (routerLink === EMPTY_PROP) return; | ||
|
|
||
| if (navManager !== undefined) { | ||
| const navigationPayload: any = { event: ev }; | ||
| for (const key in props) { | ||
| const value = props[key]; | ||
| if ( | ||
|
|
@@ -168,7 +168,7 @@ | |
| } | ||
| }; | ||
|
|
||
| let propsToAdd: any = { | ||
| ref: containerRef, | ||
| class: getElementClasses(containerRef, classes), | ||
| onClick: handleClick, | ||
|
|
@@ -185,7 +185,7 @@ | |
| if ( | ||
| // eslint-disable-next-line no-prototype-builtins | ||
| (props.hasOwnProperty(key) && value !== EMPTY_PROP) || | ||
| key.startsWith(ARIA_PROP_PREFIX) | ||
| (key.startsWith(ARIA_PROP_PREFIX) && value !== EMPTY_PROP) | ||
| ) { | ||
| propsToAdd[key] = value; | ||
| } | ||
|
Comment on lines
185
to
191
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๐ฏ Functional Correctness | ๐ก Minor | โก Quick win Add regression coverage for sentinel-valued and explicit ARIA props. Test that omitted ARIA props never reach the custom element as a sentinel string, while explicit values such as ๐ค Prompt for AI Agents |
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| diff --git a/dist/runtime.cjs.js b/dist/runtime.cjs.js | ||
| index 8d1b57d..8aaa91b 100644 | ||
| --- a/dist/runtime.cjs.js | ||
| +++ b/dist/runtime.cjs.js | ||
| @@ -116,7 +116,7 @@ const ARIA_PROP_PREFIX = 'aria'; | ||
| * and then check if it is not undefined for Vue >= 3.1.0. | ||
| * See https://github.com/vuejs/vue-next/issues/3889 | ||
| */ | ||
| -const EMPTY_PROP = Symbol(); | ||
| +const EMPTY_PROP = {}; | ||
| const DEFAULT_EMPTY_PROP = { default: EMPTY_PROP }; | ||
| const getComponentClasses = (classes) => { | ||
| return classes?.split(' ') || []; | ||
| diff --git a/dist/runtime.js b/dist/runtime.js | ||
| index 7efe4d9..4415241 100644 | ||
| --- a/dist/runtime.js | ||
| +++ b/dist/runtime.js | ||
| @@ -114,7 +114,7 @@ const ARIA_PROP_PREFIX = 'aria'; | ||
| * and then check if it is not undefined for Vue >= 3.1.0. | ||
| * See https://github.com/vuejs/vue-next/issues/3889 | ||
| */ | ||
| -const EMPTY_PROP = Symbol(); | ||
| +const EMPTY_PROP = {}; | ||
| const DEFAULT_EMPTY_PROP = { default: EMPTY_PROP }; | ||
| const getComponentClasses = (classes) => { | ||
| return classes?.split(' ') || []; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,3 +25,4 @@ overrides: | |
|
|
||
| patchedDependencies: | ||
| '@stencil/core': "patches/@stencil__core.patch" | ||
| '@stencil/vue-output-target': "patches/@stencil__vue-output-target.patch" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ๐ Maintainability & Code Quality | ๐ Major | โก Quick win Add a changeset for this accessibility behavior change. This PR changes Vue wrapper behavior and user-facing accessibility output. Add a changeset for the affected package, or explicitly justify in the PR why the change is internal-only. ๐ค Prompt for AI AgentsSource: Path instructions |
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since
EMPTY_PROPis now defined as a plain object{}instead of a uniqueSymbol(), it is mutable. To prevent accidental mutation of this sentinel value elsewhere in the codebase, it is highly recommended to freeze the object usingObject.freeze().There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[EMPTY_PROP] is only used as a sentinel compared by reference equality [value !== EMPTY_PROP] and is never mutated anywhere, so freezing isn't functionally required. I've left it as a plain {} for now to keep the patch minimal and aligned with the upstream source.