Skip to content

Conversation

@DanielleHuisman
Copy link
Contributor

It is currently not possible to achieve PrimeVue's default option behaviour for optionLabel and optionValue, because null and undefined are always overridden by 'label' and 'value' respectively. This is PrimeVue's default optionValue behaviour:

Property name or getter function to use as the value of an option, defaults to the option itself when not defined.

This PR removes the defaults to restore PrimeVue's behaviour. This will break applications that rely on this behaviour, so I'm not sure what would be the best way to proceed. I can think of some options:

  • Add a warning when optionLabel or optionValue is null or undefined, so existing applications are notified of the change. Adding a flag to disable the warning would be useful.
  • Add a global flag to enable/disable the existing behaviour
  • Release this change in the next major version (v2). As a side note: I think maintenance effort can be reduced by using v-bind instead of specifying all options separately. Such a change would be suitable for a major release.

@sfxcode
Copy link
Owner

sfxcode commented Jan 13, 2024

Hello Danielle,

you are right, i will merge it for the next 1.6.x release. Global flags seems for me a overkill for this small helper library, so i will mark it at breaking change. Thank you for pointing out !

@sfxcode sfxcode merged commit 5fa0972 into sfxcode:main Jan 13, 2024
@DanielleHuisman DanielleHuisman deleted the fix/option-defaults branch January 13, 2024 12:35
@sfxcode
Copy link
Owner

sfxcode commented Feb 28, 2024

  • Release this change in the next major version (v2). As a side note: I think maintenance effort can be reduced by using v-bind instead of specifying all options separately. Such a change would be suitable for a major release.

Hi Danielle, just want to let you know that the latest version 1.8.0 supports all attributes over v-bind.

Have a nice coding time,

Tom

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.

2 participants