-
-
Notifications
You must be signed in to change notification settings - Fork 151
fix(BTab): error in recursion #2624
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
Conversation
|
commit: |
I don't get it |
I'm not 100% sure I get it either... I think it's so that we can't reference other computed or reactive directly. This could have been converted to a function like the others, but given that with this even this worked: <template>
<BContainer>
<BRow>
<BCol>
<b-tabs>
<b-tab
v-for="(tab, index) in [
{identifier: 'Tab1', label: 'Tab 1'},
{identifier: 'Tab2', label: 'Tab 2'},
]"
:key="index"
style="background-color: red"
:title="tab.label"
@click="t"
>
{{ tab.identifier }}
</b-tab>
</b-tabs>
</BCol>
</BRow>
</BContainer>
</template>
<script setup lang="ts">
import {computed, ref} from 'vue'
const d = ref(true)
const t = computed(() => (d.value ? console.warn : console.log))
setInterval(() => {
d.value = !d.value
}, 1000)
</script> |
The internally onClick doesn't have to be reactive since it doesn't effect the rendering. |
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.
Pull Request Overview
This pull request fixes a recursion error in the BTab component.
- Removes the onClick property from the computed attributes to avoid unwanted recursive behavior.
- Updates how attributes and onClick events are passed down in the component.
Comments suppressed due to low confidence (2)
packages/bootstrap-vue-next/src/components/BTabs/BTab.vue:10
- Verify that removing 'tabAttrs' and binding the entire 'processedAttrs' does not introduce unwanted attributes into the component, which might inadvertently cause recursion issues.
v-bind="processedAttrs"
packages/bootstrap-vue-next/src/components/BTabs/BTab.vue:79
- Confirm that using 'attrs.onClick' directly for the onClick handler safely replaces the earlier approach while fully resolving the recursion error.
onClick: attrs.onClick,
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.
^
Co-authored-by: Issayah <github.private.imcvv@slmail.me>
* upstream/main: (184 commits) fix(BDropdown): don't calulcate the position when dropdown is not shown. docs(BTable): complete documentation for table items provider (bootstrap-vue-next#2662) fix(BPagination): right/left/up/down arrow keys now operating better after new page chosen (bootstrap-vue-next#2665) add the check to hide as well fix(useShowHide): don't run show if component already unmounted (ie. BPopover) fix(BAccordionItem): fix initial modelValue feat(BModal)!: remove autofocus and autofocusButton props and add more versitile focus prop feat(BOffcanvas)!: remove nofocus prop and add more versitile focus prop feat(BModal): return focus to previous element on close feat(BOffcanvas): return focus to previous element on close fix(BModal): set focus only once chore: release main (bootstrap-vue-next#2659) bth and btd scope attribute updates and bpagination li element needs presentation role (bootstrap-vue-next#2646) feat(BBreadcrumb): allow it to use individual breadcrumb trails with useBreadcrumb by passing prop id to component and id param to composable fixes bootstrap-vue-next#2630 Revert "fix(BButton): Consume useColorVariantClasses (bootstrap-vue-next#2640)" (bootstrap-vue-next#2654) chore: release main fixes bootstrap-vue-next#2643 feat(BTable): Expose additional functions and document them (bootstrap-vue-next#2632) fix(BButton): Consume useColorVariantClasses (bootstrap-vue-next#2640) docs(BButton): Outline variant example (bootstrap-vue-next#2639) fix(BTab): error in recursion (bootstrap-vue-next#2624) fix(BTable): correct multi-sort to not update sortby in place (bootstrap-vue-next#2644) Update BDropdownForm.vue (bootstrap-vue-next#2635) doc(BTable): Fill out light-weight, helper component and accessibility sections (bootstrap-vue-next#2629) chore: release main (bootstrap-vue-next#2626) ...
fixes #2620
Describe the PR
A clear and concise description of what the pull request does.
Small replication
A small replication or video walkthrough can help demonstrate the changes made. This is optional, but can help observe the intended changes. A mentioned issue that contains a replication also works.
PR checklist
What kind of change does this PR introduce? (check at least one)
fix(...)
feat(...)
fix(...)
docs(...)
The PR fulfills these requirements:
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