You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "parag2131 (via GitHub)" <gi...@apache.org> on 2026/06/03 17:10:15 UTC
[D] Embedded SDK: How to navigate to specific tab using button click in Markdown chart? [superset]
GitHub user parag2131 created a discussion: Embedded SDK: How to navigate to specific tab using button click in Markdown chart?
### Bug description
Hi everyone,
I have a Superset dashboard embedded in an external app using the
embedded SDK and guest tokens (with RLS).
On the Home tab, I have buttons inside Markdown charts. When a user
clicks a button, I want to open a specific tab directly.
What I tried:
1. href link with target="_top" → works but loads public permalink
URL, bypassing guest token and RLS
2. urlParams: { anchor: 'TAB-xxxx' } in embedDashboard config →
dashboard always opens on Home tab, anchor is ignored
3. postMessage from iframe to parent → message never received
Has anyone successfully navigated to a specific tab from a Markdown
button click inside an embedded dashboard while keeping the guest
token and RLS active?
Any solution or workaround is appreciated. Thank you!
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
3.9
### Node version
16
### Browser
Chrome
### Additional context
_No response_
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to my problem.
- [ ] I have searched the GitHub issue tracker and didn't find a similar bug report.
- [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
GitHub link: https://github.com/apache/superset/discussions/40726
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [D] Embedded SDK: How to navigate to specific tab using button click in Markdown chart? [superset]
Posted by "dosubot[bot] (via GitHub)" <gi...@apache.org>.
GitHub user dosubot[bot] added a comment to the discussion: Embedded SDK: How to navigate to specific tab using button click in Markdown chart?
<!-- Answer -->
This is a known limitation of the embedded SDK — there's currently **no programmatic API to switch dashboard tabs after the iframe loads**. The communication between the parent and embedded iframe uses a MessageChannel/MessagePort protocol (not raw `postMessage`), which is why your approach #3 didn't work [[1]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-embedded-sdk/src/index.ts) [[2]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/embedded/index.tsx).
Here's why each approach fails and what you can try:
**Why `urlParams: { anchor: 'TAB-xxxx' }` doesn't work:** Anchor links were intentionally removed from embedded dashboards in v5.0.0. A [fix was introduced in PR #36924](https://github.com/apache/superset/pull/36924) that re-adds anchor scrolling support in embedded mode, but this targets scroll positioning rather than full tab switching [[3]](https://github.com/apache/superset/pull/36924) [[4]](https://github.com/apache/superset/issues/36132#issuecomment-3540828227).
**Why `postMessage` doesn't work:** The SDK doesn't use raw `window.postMessage` for communication. It uses a `Switchboard` abstraction over `MessageChannel`/`MessagePort`, with a specific handshake protocol using `"__embedded_comms__"` messages [[5]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/packages/superset-ui-switchboard/src/switchboard.ts). The available methods (`getActiveTabs`, `getDashboardPermalink`, etc.) are read-only — there is no `setActiveTab` method exposed [[6]](https://github.com/apache/superset/blob/829e4d92d91ceae4b43b1ed3b063ffe45377799c/superset-frontend/src/embedded/index.tsx#L228-L260).
**Possible workarounds:**
1. **Use `permalink_key` in `urlParams`** — Generate a permalink that includes the target tab's state via the `/api/v1/dashboard/{id}/permalink` endpoint, then pass it as `urlParams: { permalink_key: "KEY" }`. This visually selects the tab, though there's a reported bug where content may still show the first tab [[4]](https://github.com/apache/superset/issues/36132#issuecomment-3540828227).
2. **Separate embedded dashboards per "view"** — Instead of tabs, create separate dashboards for each section and embed the appropriate one based on button clicks in your parent app.
3. **Manually manipulate the iframe URL** — From the parent app, update the iframe `src` to append `#TAB-xxxx` as a hash. This requires re-rendering the iframe, which loses state but does navigate to the correct tab.
4. **Embed individual charts** — If tabs represent distinct chart groups, consider embedding individual charts rather than the full dashboard.
None of these are ideal. Extending the Switchboard protocol to include a `setActiveTab` method would be the proper solution but would require a code contribution to the project.
<!-- Dosu Comment Footer -->
*To reply, just mention [@dosu](https://go.dosu.dev/dosubot?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=reply-with-mention&utm_term=apache%2Fsuperset).*
---
Docs are dead. Just use [Dosu](https://dosu.dev?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-tagline&utm_term=apache%2Fsuperset).
[](https://app.dosu.dev/response-feedback?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-feedback&utm_term=apache%2Fsuperset&message_id=7df6e7b5-9d39-43fa-a1ea-89604ba3b019) [](https://github.dosu.com/apache/superset?utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-ask-repo&utm_term=apache%2Fsuperset) [](https://app.dosu.dev/signup?referrer=openSource&source=github-footer&utm_source=github&utm_medium=bot-comment&utm_campaign=github-comment-footer-20260415&utm_content=static-docs-share-team&utm_term=apache%2Fsuperset)
GitHub link: https://github.com/apache/superset/discussions/40726#discussioncomment-17169443
----
This is an automatically sent email for notifications@superset.apache.org.
To unsubscribe, please send an email to: notifications-unsubscribe@superset.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org