Skip to content
New issue

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

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

Already on GitHub? # to your account

fix(tabbed content): prevent duplicate ids error #5216

Conversation

TomJGooding
Copy link
Contributor

@TomJGooding TomJGooding commented Nov 7, 2024

Fixes #5215 where removing then adding a pane could crash with a DuplicateIds exception.

Rather than assigning the ID based on the current tab count, this adds a _cumulative_tab_count to ensure added panes have a unique ID.

Please review the following checklist.

  • Docstrings on all new or modified functions / classes
  • Updated documentation
  • Updated CHANGELOG.md (where appropriate)

Fixes Textualize#5215 where removing
then adding a pane could crash with a `DuplicateIds` exception.

Rather than assigning the ID based on the *current* tab count, this adds
a `_cumulative_tab_count` to ensure added panes have a unique ID.
@TomJGooding
Copy link
Contributor Author

This doesn't fix the highlighting issue when tabs are removed (#5215 (comment)), but that should probably be a separate issue/PR.

@TomJGooding TomJGooding marked this pull request as ready for review November 7, 2024 18:28
@TomJGooding TomJGooding closed this Nov 9, 2024
@TomJGooding TomJGooding deleted the fix-tabbed-content-prevent-duplicate-ids-error branch November 9, 2024 11:45
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

DuplicateIds exception raised when removing a tab and adding a new tab
1 participant