Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: reset hidden state when removing panel from tabsheet #7696

Merged
merged 2 commits into from
Aug 28, 2024

Conversation

web-padawan
Copy link
Member

Description

This fixes a finding with React component reported internally on Slack:

<TabSheet>
  <Button>Close all</Button>
  <TabSheetTab label="One" />
  <TabSheetTab label="Two" />
  <TabSheetTab label="Three" />
</TabSheet>

add the missing slot="prefix" to <Button> - how come the UI is not updated with HMR but requires a refresh?

The actual problem is that the web component treats any elements without slot attribute as panels and then doesn’t reset hidden attribute when the slot is set (or e.g. when the element is moved to the different parent).

Type of change

  • Bugfix

Note

There is an edge case with hidden set initially on the panel before adding it to tabsheet - it will be reset to false on removing. I don't think it's a big problem

@web-padawan web-padawan requested a review from tomivirkki August 27, 2024 07:55
@web-padawan web-padawan requested a review from tomivirkki August 28, 2024 08:36
Copy link

@web-padawan web-padawan merged commit a1c221f into main Aug 28, 2024
9 checks passed
@web-padawan web-padawan deleted the fix/tabsheet-reset-hidden branch August 28, 2024 08:42
web-padawan added a commit that referenced this pull request Aug 28, 2024
)

Co-authored-by: Serhii Kulykov <iamkulykov@gmail.com>
@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.5.0.alpha13 and is also targeting the upcoming stable 24.5.0 version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants