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: observe tabs ID attribute changes and update panels #7201

Merged
merged 3 commits into from Mar 18, 2024

Conversation

web-padawan
Copy link
Member

Description

Fixes vaadin/flow-components#6072

Here's the code example to reproduce the issue and test the fix:

<vaadin-tabsheet>
  <vaadin-tabs slot="tabs">
    <vaadin-tab>Tab 1</vaadin-tab>
    <vaadin-tab>Tab 2</vaadin-tab>
  </vaadin-tabs>

  <div tab="tab-1">Panel 1</div>
  <div tab="tab-2">Panel 2</div>
</vaadin-tabsheet>

Put this to dev page and try to set id on the first vaadin-tab to tab-1.

Type of change

  • Bugfix

Note

Initially, I was thinking about adding a warning for vaadin-tab elements without id attribute set. However, Flow does not set id attribute when using setVisible(false) and it's by design, so in this case the warning would be redundant.

This fix can be also considered as "feature", as it also adds an option to un-link tab with panel by setting id to null.

packages/tabsheet/src/vaadin-tabsheet-mixin.js Outdated Show resolved Hide resolved
packages/tabsheet/src/vaadin-tabsheet-mixin.js Outdated Show resolved Hide resolved
Copy link

sonarcloud bot commented Mar 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@web-padawan web-padawan removed the request for review from vursen March 18, 2024 11:34
@web-padawan web-padawan merged commit 8b975e7 into main Mar 18, 2024
9 checks passed
@web-padawan web-padawan deleted the fix/tabs-observe-id branch March 18, 2024 11:35
@vaadin-bot
Copy link
Collaborator

Hi @web-padawan and @web-padawan, when i performed cherry-pick to this commit to 24.3, i have encountered the following issue. Can you take a look and pick it manually?
Error Message:
Error: Command failed: git cherry-pick 8b975e7
error: could not apply 8b975e7... fix: observe tabs ID attribute changes and update panels (#7201)
hint: After resolving the conflicts, mark them with
hint: "git add/rm ", then run
hint: "git cherry-pick --continue".
hint: You can instead skip this commit with "git cherry-pick --skip".
hint: To abort and get back to the state before "git cherry-pick",
hint: run "git cherry-pick --abort".

@vaadin-bot
Copy link
Collaborator

This ticket/PR has been released with Vaadin 24.4.0.alpha17 and is also targeting the upcoming stable 24.4.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.

A tab in a tabsheet component can't be visible if it is initially hidden
3 participants