vaadin / cookbook

Copy & paste recipes for Vaadin
https://cookbook.vaadin.com/
Apache License 2.0
20 stars 38 forks source link

Vaadin Tabs with Routes example is having some bugs #304

Closed Alexenon closed 8 months ago

Alexenon commented 1 year ago

Description of the bug

List of bugs that I found:

  1. When performing multiple clicks on tab View B with parameter 'text', the text inside the tab is concatenating, which I suppose is not expected behavior.
  2. Another unexpected behavior is when clicking on the TAB and not on the TEXT, the Tab is marked as active while content doesn't change to the expected content from the active tab. It remains the same.

For item 2 here is a JavaScript code snippet to check in dev tools in any browser.

NOTE: Don't swap tabs before checking, remain on "View A" tab, or just refresh page before executing script below. PS: Item 2 can be manually checked by clicking on tab and not on the text inside tab

const element = document.evaluate(
  '//vaadin-tab[@tabindex="-1" and a]',
  document,
  null,
  XPathResult.FIRST_ORDERED_NODE_TYPE,
  null
).singleNodeValue;

element.click();

Expected behavior

  1. The text shouldn't concatenate.
  2. View content should change using active tab, not just by clicking the text inside the tab, but also the tab itself.

Minimal reproducible example

See https://cookbook.vaadin.com/tabs-with-routes/b/text

Versions

github-actions[bot] commented 8 months ago

There has not been any activity on this issue for 60 days and it is going to be marked as stale and closed in 7 days.