Skip to content

[Vue 2] Incorrect widget height/width in grid-stack's 'added' callback without setTimeout #3065

Closed
@jeceldx

Description

@jeceldx

Hi ,I'm sorry to bring up the issue here, as the slack link in the README seems to have expired and I've tried several times but still can't access the community

I'm encountering an issue with Vue 2 and grid-stack when rendering components. Here's what I'm doing:


  1. Rendering components using v-for in the template
  2. Initializing them as widgets with makeWidget()
  3. Trying to get the widget's latest height/width(use this.$el.clientWidth) in grid-stack's added callback
    
    The problem: I only get correct height/width when using setTimeout, otherwise the values are incorrect.
    
    Any suggestions to get accurate dimensions without relying on setTimeout?
    
    Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions