fast icon indicating copy to clipboard operation
fast copied to clipboard

fix(foundation): tabs minimum value to grid column on transition

Open yinonov opened this issue 3 years ago • 4 comments

tabs active-indicator is janky on first change due to its grid-column css property being set to 0. this is now fixed by conditionally assigning a value of, at least, 1 instead if equals 0.

image

Pull Request

📖 Description

🎫 Issues

👩‍💻 Reviewer Notes

📑 Test Plan

✅ Checklist

General

  • [ ] I have included a change request file using $ yarn change
  • [ ] I have added tests for my changes.
  • [ ] I have tested my changes.
  • [ ] I have updated the project documentation to reflect my changes.
  • [ ] I have read the CONTRIBUTING documentation and followed the standards for this project.

Component-specific

⏭ Next Steps

yinonov avatar Dec 29 '22 07:12 yinonov

This is just an fyi/workaround for this issue, for folks that are still using the archived fast-components.

If you set an initial activeid on the tabs element to one of the tabs' id, it fixes the jumpy indicator. Tabs will set ids for you on each tab, or you can provide your own.

<fast-tabs activeid="tab-1">
    <fast-tab slot="tab" id="tab-1">Tab one</fast-tab>
    <fast-tab slot="tab" id="tab-2">Tab two</fast-tab>
    <fast-tab slot="tab" id="tab-3">Tab three</fast-tab>
    <fast-tab-panel slot="tabpanel">Tab panel 1</fast-tab-panel>
    <fast-tab-panel slot="tabpanel">Tab panel 2</fast-tab-panel>
    <fast-tab-panel slot="tabpanel">Tab panel 3</fast-tab-panel>
</fast-tabs>

KingOfTac avatar Dec 29 '22 19:12 KingOfTac

This is just an fyi/workaround for this issue, for folks that are still using the archived fast-components.

If you set an initial activeid on the tabs element to one of the tabs' id, it fixes the jumpy indicator. Tabs will set ids for you on each tab, or you can provide your own.

<fast-tabs activeid="tab-1">
    <fast-tab slot="tab" id="tab-1">Tab one</fast-tab>
    <fast-tab slot="tab" id="tab-2">Tab two</fast-tab>
    <fast-tab slot="tab" id="tab-3">Tab three</fast-tab>
    <fast-tab-panel slot="tabpanel">Tab panel 1</fast-tab-panel>
    <fast-tab-panel slot="tabpanel">Tab panel 2</fast-tab-panel>
    <fast-tab-panel slot="tabpanel">Tab panel 3</fast-tab-panel>
</fast-tabs>

personally I think css should enforce defaults on its own to protect run-time from such cases. anyway, this suggested workaround would need to be documented to authors as a caveat and, fairly, this could be forgotten easily. it's a matter of ergonomics

yinonov avatar Dec 29 '22 21:12 yinonov

Fixes #6455 (?)

yinonov avatar Jan 04 '23 08:01 yinonov

Looks like we need to add a change file, can you run yarn change to generate one?

janechu avatar Sep 11 '24 17:09 janechu