Skip to content
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

Twice render if $attrs.id not defined #5412

Closed
i7slegend opened this issue Mar 13, 2024 · 0 comments · Fixed by #5486 or DallinAllred/ezanalytics#11
Closed

Twice render if $attrs.id not defined #5412

i7slegend opened this issue Mar 13, 2024 · 0 comments · Fixed by #5486 or DallinAllred/ezanalytics#11
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Milestone

Comments

@i7slegend
Copy link
Contributor

i7slegend commented Mar 13, 2024

prev issue #4953

Hello! I can't reopen previous issue.

I found what commits before doesn't goals to fix trigger render twice in this issue's example. It's reproduces now

I mean in the attached code block before (#4953 (comment)) this (use OR operator in state component for id property).
Example for Menubar component:

    data() {
        return {
-           id: this.$attrs.id,
+           id: this.$attrs.id || UniqueComponentId(),
            filterValue: null,
            focused: false,
            focusedOptionIndex: -1
        };
    },
    watch: {
        '$attrs.id': function (newValue) {
            this.id = newValue || UniqueComponentId();
        },
        options() {
            this.autoUpdateModel();
        }
    },
    mounted() {
-       this.id = this.id || UniqueComponentId();
        this.autoUpdateModel();
    },

Originally posted by @i7slegend in #4953 (comment)

i7slegend added a commit to i7slegend/primevue that referenced this issue Mar 27, 2024
i7slegend added a commit to i7slegend/primevue that referenced this issue Mar 27, 2024
@tugcekucukoglu tugcekucukoglu added this to the 3.51.0 milestone Apr 3, 2024
@tugcekucukoglu tugcekucukoglu added the Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add label Apr 3, 2024
tugcekucukoglu added a commit that referenced this issue Apr 3, 2024
Fix #5412 - Twice render if attribute id not defined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Enhancement Issue contains an enhancement related to a specific component. Additional functionality has been add
Projects
None yet
2 participants