Skip to content

Conversation

@dwgray
Copy link
Member

@dwgray dwgray commented Mar 27, 2024

Describe the PR

Fix #1822 (Empty string as entry in options array of BFormCheckboxGroup returned as true in v-model) by inlining the string | boolean part of the CheckboxValue type in the defineProps of BFormCheckboxGroup.vue.

According the the vue docs, the way to disable the boolean casting rule in this case is to make sure string comes before boolean in the type union. Changing the type definition in CheckBoxTypes.ts wasn't sufficient because the compiler-sfc doesn't crawl external files, so prepended the string | boolean part of the union inline in the place that compiler-sfc uses. This is somewhat ugly, but I believe it is better than the alternatives that I considered:

  • Redefine CheckboxValue in BFormCheckboxGroup.vue
  • Move the definitions in CheckboxTypes.ts to BFormCheckboxGroup.vue and then make index.ts in types refer to those definitions

Small replication

See #1822

PR checklist

What kind of change does this PR introduce? (check at least one)

  • Bugfix 🐛 - fix(...)
  • Feature - feat(...)
  • ARIA accessibility - fix(...)
  • Documentation update - docs(...)
  • Other (please describe)

The PR fulfills these requirements:

  • Pull request title and all commits follow the Conventional Commits convention or has an override in this pull request body This is very important, as the CHANGELOG is generated from these messages, and determines the next version type. Pull requests that do not follow conventional commits or do not have an override will be denied

@bolt-new-by-stackblitz
Copy link

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

@VividLemon
Copy link
Member

@dwgray merge conflict detected 🤖

Copy link
Member

@VividLemon VividLemon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Get your PR fixed 🤣

@VividLemon VividLemon merged commit 51d7c01 into bootstrap-vue-next:main Apr 14, 2024
@dwgray dwgray deleted the empty-string-checkgroup branch June 11, 2024 21:30
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.

Empty string as entry in options array of BFormCheckboxGroup returned as true in v-model

2 participants