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(compat): fix compat handler of draggable #12445

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/runtime-dom/src/modules/attrs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ export function compatCoerceAttr(
): boolean {
if (isEnumeratedAttr(key)) {
const v2CoercedValue =
value === null
value === null || value === false || value === 'false'
? 'false'
: typeof value !== 'boolean' && value !== undefined
: value !== undefined
? 'true'
: null
if (
Expand Down
8 changes: 8 additions & 0 deletions packages/vue-compat/__tests__/global.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -500,3 +500,11 @@ test('local app config should not affect other local apps in v3 mode', () => {
const app2 = createApp({})
expect(app2.config.globalProperties.test).toBe(undefined)
})

test('ATTR_ENUMERATED_COERCION: true', () => {
const vm = new Vue({
compatConfig: { ATTR_ENUMERATED_COERCION: true },
template: `<div><div draggable="false">hello</div></div>`,
}).$mount()
expect(vm.$el.innerHTML).toBe(`<div draggable="false">hello</div>`)
})