primevue icon indicating copy to clipboard operation
primevue copied to clipboard

Fixes #2651 RadioButton deprecated v-bind use on non-boolean attributes

Open FossPrime opened this issue 2 years ago • 3 comments

The following warning results in Vue 3 with Sakai and the latest Primevue

https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html

[Vue warn]: (deprecation ATTR_FALSE_VALUE) Attribute "aria-checked" with v-bind value `false` will render aria-checked="false" instead of removing it in Vue 3. To remove the attribute, use `null` or `undefined` instead. If the usage is intended, you can disable the compat behavior and suppress this warning with:

  configureCompat({ ATTR_FALSE_VALUE: false })

  Details: https://v3-migration.vuejs.org/breaking-changes/attribute-coercion.html 
  at <RadioButton id="input_outlined" name="inputstyle" value="outlined"  ... > 
  at <AppConfig layoutMode="static" onLayoutChange=fn<bound onLayoutChange> > 
  at <App onVnodeUnmounted=fn<onVnodeUnmounted> ref=Ref< undefined > > 
  at <RouterView> 
  at <AppWrapper>

Defect Fixes

When submitting a PR, please also create an issue documenting the error.

FossPrime avatar Jun 03 '22 20:06 FossPrime

Could you please create an issue with a codesandbox sample for this PR?

tugcekucukoglu avatar Jun 06 '22 06:06 tugcekucukoglu

Okay it's github issue #2651

image https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Attributes/aria-checked

The correct approach has always been to output the html aria-checked="false" not remove the attribute. The warning is clarifying that using false to output 'false' is strongly discouraged, as it's confusing for developers coming from Vue 2 or who use Vue 2 in tandem with Vue 3 via the @vue/compat library, where using false removes the attribute all together.

Code Sandbox: https://stackblitz.com/edit/vitejs-vite-1gddzi image

FossPrime avatar Jun 06 '22 20:06 FossPrime

an ugly workaround i've resorted to is copying RadioButton.vue to /patch/RadioButton.vue and importing the modified version. I tried Vite's global search and replace, but that seems to work only on single variable global references, not statements with spaces and special characters.

FossPrime avatar Jun 10 '22 21:06 FossPrime

RadioButton was in heavy development. Please try to v3.16.0. If the problem still persists, please create a new issue.

tugcekucukoglu avatar Aug 16 '22 06:08 tugcekucukoglu