nestedProps wont live update

Offen
#319 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Dieses Issue hat noch niemand übernommen.

Bewertung

Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Anfängerfreundlichkeit
43/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
figma, typescript
Bereich
tooling

Rechercherichtung

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.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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
Vorherrschende Sprache
TypeScript
Sterne
1.6k
Forks
126
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus figma/code-connect

Alle Issues in figma/code-connect

Ähnliche Issues

Weitere Issues zu TypeScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.