Skip to content

Commit

Permalink
Fix tab current page and clipboard index
Browse files Browse the repository at this point in the history
  • Loading branch information
caleeli committed Oct 1, 2024
1 parent e433b1e commit 01d42c6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/components/TabsBar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ export default {
},
tabOpened() {
const pageIndex = this.localOpenedPages[this.activeTab];
const isInClipboard = this.activeTab === this.$refs.tabs.tabs.length - 1;
const isInClipboard = (this.activeTab === this.$refs.tabs.tabs.length - 1) && this.showClipboard;
if (isInClipboard) {
this.$emit("tab-opened", this.clipboardPageIndex);
} else {
Expand Down
18 changes: 9 additions & 9 deletions src/components/vue-form-builder.vue
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
</template>
<template #default="{ currentPage: tabPage }">
<b-button
v-if="isClipboardPage(currentPage)"
v-if="isClipboardPage(tabPage)"
variant="link"
@click="clearClipboard"
>
Expand Down Expand Up @@ -203,14 +203,14 @@
{{ element.config.name || element.label || $t("Field Name") }}
<div class="ml-auto">
<clipboard-button
v-if="!isClipboardPage(currentPage)"
v-if="!isClipboardPage(tabPage)"
:index="index"
:config="element.config"
:isInClipboard="isInClipboard(extendedPages[currentPage].items[index])"
:isInClipboard="isInClipboard(extendedPages[tabPage].items[index])"
:addTitle="$t('Add to clipboard')"
:removeTitle="$t('Remove from clipboard')"
@addToClipboard="addToClipboard(extendedPages[currentPage].items[index])"
@removeFromClipboard="removeFromClipboard(extendedPages[currentPage].items[index])"
@addToClipboard="addToClipboard(extendedPages[tabPage].items[index])"
@removeFromClipboard="removeFromClipboard(extendedPages[tabPage].items[index])"
/>
<button
v-if="isAiSection(element) && aiPreview(element)"
Expand Down Expand Up @@ -268,14 +268,14 @@
{{ element.config.name || $t("Variable Name") }}
<div class="ml-auto">
<clipboard-button
v-if="!isClipboardPage(currentPage)"
v-if="!isClipboardPage(tabPage)"
:index="index"
:config="element.config"
:isInClipboard="isInClipboard(extendedPages[currentPage].items[index])"
:isInClipboard="isInClipboard(extendedPages[tabPage].items[index])"
:addTitle="$t('Add to clipboard')"
:removeTitle="$t('Remove from clipboard')"
@addToClipboard="addToClipboard(extendedPages[currentPage].items[index])"
@removeFromClipboard="removeFromClipboard(extendedPages[currentPage].items[index])"
@addToClipboard="addToClipboard(extendedPages[tabPage].items[index])"
@removeFromClipboard="removeFromClipboard(extendedPages[tabPage].items[index])"
/>
<button
class="btn btn-sm btn-secondary mr-2"
Expand Down

0 comments on commit 01d42c6

Please sign in to comment.