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

Close configuration panel of the input widgets when out of edit-mode #1664

Conversation

ArturoManzoli
Copy link
Contributor

  • Fixed the panel closure conditions;
  • Fixed the text on the Side config panel that has a incorrect reference to URL parameters;

Fixes #1663

Copy link
Member

@rafaellehmkuhl rafaellehmkuhl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's working fine, but Vue offers a better way to do that were you don't have to inject the drawer logic inside other's components logics and that makes sure it will continue to work even if someone adds new exit logics. For that you can use a watch.

You would add a watch in the store that listen for changes in the view index and editMode, and with that nothing is tied anymore and this code will work forever:

  watch([editingMode, currentViewIndex], ([isInEditMode, newViewIdx], [, oldViewIdx]) => {
    if (!isInEditMode || newViewIdx !== oldViewIdx) {
      elementToShowOnDrawer.value = undefined
    }
  })

@ArturoManzoli ArturoManzoli force-pushed the 1663-Input-Widget-configuration-persists-outside-edit-mode branch from 9bae773 to 5d0d353 Compare February 6, 2025 17:43
@ArturoManzoli ArturoManzoli merged commit f85b28e into bluerobotics:master Feb 6, 2025
11 checks passed
@rafaellehmkuhl rafaellehmkuhl changed the title 1663 input widget configuration persists outside edit mode Close configuration panel of the input widgets when out of edit-mode Feb 6, 2025
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.

frontend: editor: Input Widget configuration persists outside edit mode
2 participants