-
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 1 commit
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 = {}; | ||||||
|
Contributor
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. Since
Suggested change
Collaborator
Author
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. [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. |
||||||
| 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,28 @@ | ||
| diff --git a/dist/runtime.cjs.js b/dist/runtime.cjs.js | ||
| index 0000000..0000000 100644 | ||
| --- a/dist/runtime.cjs.js | ||
| +++ b/dist/runtime.cjs.js | ||
| @@ -114,7 +114,7 @@ exports.createSsrApp = createSsrApp; | ||
| * you to check if the key exists for Vue <3.1.0 | ||
| * 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 0000000..0000000 100644 | ||
| --- a/dist/runtime.js | ||
| +++ b/dist/runtime.js | ||
| @@ -114,7 +114,7 @@ export { createSsrApp }; | ||
| * you to check if the key exists for Vue <3.1.0 | ||
| * 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(' ') || []; |
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.
Using
patch-packagein apnpmworkspace is highly discouraged and can lead to issues. Sincepnpmuses a global content-addressable store and hard links files intonode_modules, runningpatch-packagecan directly modify files in the global store, potentially corrupting it for other projects on the same machine. Additionally, it may not apply reliably due topnpm's symlink structure.Instead, use
pnpm's native patching mechanism:pnpm patch @stencil/vue-output-targetto extract the package to a temporary directory.pnpm patch-commit <temp-dir>to generate the patch file and automatically configure it underpatchedDependenciesin your configuration file (e.g.,pnpm-workspace.yamlorpackage.jsondepending on your pnpm version).patch-packageandpostinstall-postinstallfrom yourdevDependencies.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.
I've migrated away from patch-package to pnpm's native patching mechanism to stay consistent with the existing @stencil/core patch and avoid the content-addressable store risks you mentioned.