8000 fix(BTab): error in recursion by xvaara · Pull Request #2624 · bootstrap-vue-next/bootstrap-vue-next · GitHub
[go: up one dir, main page]

Skip to content

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

Merged
merged 2 commits into from
Apr 8, 2025

Conversation

xvaara
Copy link
Contributor
@xvaara xvaara commented Mar 27, 2025

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)

  • 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

Copy link

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

Copy link
pkg-pr-new bot commented Mar 27, 2025

bsvn-vite-ts

npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next@2624
npm i https://pkg.pr.new/bootstrap-vue-next/bootstrap-vue-next/@bootstrap-vue-next/nuxt@2624

commit: 3562712

@VividLemon
Copy link
Member

I don't get it

@xvaara
Copy link
Contributor Author
xvaara commented Mar 27, 2025

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>

@xvaara
Copy link
Contributor Author
xvaara commented Mar 27, 2025

The internally onClick doesn't have to be reactive since it doesn't effect the rendering.

@VividLemon VividLemon requested a review from Copilot March 28, 2025 18:14
Copy link
@Copilot Copilot AI left a 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,

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.

^

Co-authored-by: Issayah <github.private.imcvv@slmail.me>
@VividLemon VividLemon merged commit da6fe97 into bootstrap-vue-next:main Apr 8, 2025
4 checks passed
@github-actions github-actions bot mentioned this pull request Apr 6, 2025
xvaara added a commit to xvaara/bootstrap-vue-next that referenced this pull request Apr 28, 2025
* 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)
  ...
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.

BTab recursive attrs
2 participants
0