nestedProps wont live update

Aperta
#319 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
43/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
figma, typescript
Ambito
tooling

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
TypeScript
Stelle
1.6k
Fork
126
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di figma/code-connect

Tutte le issue di figma/code-connect

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.