nestedProps wont live update

Đang mở
#319 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
43/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
figma, typescript
Lĩnh vực
tooling

Hướng nghiên cứu

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.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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
Ngôn ngữ chính
TypeScript
Star
1.6k
Fork
126
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Chuẩn bị môi trường

Dự án này không cung cấp dev container, Dockerfile hay hướng dẫn đóng góp, nên bạn cần tự thiết lập môi trường: hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của figma/code-connect

Tất cả issue của figma/code-connect

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.