nestedProps wont live update

Ouverte
#319 0 commentaires 0 réactions 0 personnes assignées Voir sur GitHub

Personne n'a encore pris cette issue.

Évaluation

Difficulté
3/5
Temps estimé
1-2 jours
Accessibilité débutants
43/100
Type d'issue
Bug
Clarté
Plutôt claire
Activité
À l'abandon
Stack technique
figma, typescript
Domaine
tooling

Piste de recherche

Start with the figma.nestedProps mapping shown in the issue and compare it with the other form component where the same setup works. Reproduce the toggle with the provided example, then trace how nested properties are read and updated. Done means toggling the nested disabled value updates the rendered component; the issue names no test or source file to start from.

Rédigé par le modèle d'indexation à partir du texte de l'issue.

Description

API question

I have a set of form components made up of nested instances. I am trying to use nestedProps so we can toggle the different properties on and off. If I have it render the value from the property, it will use whatever the default setting is on the first render in the code example, but if you try to toggle any values, it does nothing.

Anything outside the nestedProps, e.g. validation property, works fine.

What is interesting to note is that it works fine on another form component with the same setup, which makes me think it's just a bug.

Version: 1.3.5
OS: Mac

I have tried a few things that didn't help

  • confirmed labels all match
  • Tested in both the Desktop App and Web interface.
  • changed the name of the layer to remove the dot in the middle
  • tried exposing the properties.
  • Tried setting up a code connect file for the formElement.labelGroup specifically
  • unpublished and republished in case it got into a bad state
  • I unpublished left for a couple of days, cleared my local cache republish same issue.

Am I missing something really obvious here? Could it have gotten into a bad state and i need to reset or something?

Example code:

figma.connect(RadioGroup, figmaUrl, {
    props: {
        labelDisabledProps: figma.nestedProps("formElement.labelGroup", {
            disabled: figma.boolean("isDisabled", {
                true: "true",
                false: undefined,
            }),
        }),
    },
    example: ({ labelDisabledProps }) => (
        <RadioGroup disabled={labelDisabledProps.disabled} label="label" value="value" onChange={() => {}}>
            <RadioButton value="value1" label="label1" name="radio-group" />
        </RadioGroupNew>
    ),
});

Screenshot from Figma

Image
Langage dominant
TypeScript
Étoiles
1.6k
Forks
126
Métriques de merge des PR
Aucune PR mergée en 30 j

Préparer son environnement

Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.

Par où commencer

  1. Lisez l'issue en entier, puis le guide de contribution du projet.
  2. Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
  3. Forkez le dépôt et travaillez sur une branche.
  4. Ouvrez une pull request qui référence le numéro de l'issue.

Autres issues de figma/code-connect

Toutes les issues de figma/code-connect

Issues similaires

Plus d'issues TypeScript

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.