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

Add panel in a specific index within a group without making it active #750

Closed
bjassael opened this issue Nov 3, 2024 · 3 comments · Fixed by #751
Closed

Add panel in a specific index within a group without making it active #750

bjassael opened this issue Nov 3, 2024 · 3 comments · Fixed by #751

Comments

@bjassael
Copy link

bjassael commented Nov 3, 2024

Again @mathuo thank you for the great work.

When adding a new panel to a group it gets added after the last panel in the group (either active or inactive).

We would like to be able to add it in any index within a group without making it active. As now, it is only possible to add it and right after move it (using moveTo) to the index desired. But moveTo sets the panel active, and we would like it to be inactive.
The idea of this is to mimic common browser behavior, where new tabs are added right after the active tab, instead of at the end.

A Possible solution for this would be to add a flag to "moveTo" for moving a panel without making it active. Another option is to add an index parameter in the "Position" parameter when adding a new panel, but maybe this is more complicated.

@bjassael bjassael changed the title Add new panel in a specific index within a group without making it active Add panel in a specific index within a group without making it active Nov 3, 2024
@mathuo mathuo linked a pull request Nov 3, 2024 that will close this issue
@mathuo
Copy link
Owner

mathuo commented Nov 3, 2024

Nice suggestion!

will add index to both api.addPanel within the position argument and will add index to the moveTo methods on both the panel and group api too

@mathuo mathuo reopened this Nov 3, 2024
@mathuo
Copy link
Owner

mathuo commented Nov 3, 2024

@mathuo mathuo closed this as completed Nov 3, 2024
@bjassael
Copy link
Author

bjassael commented Nov 4, 2024

Great! Thank you @mathuo! 😄

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

Successfully merging a pull request may close this issue.

2 participants