Open Seikened opened 2 weeks ago
is_external = True
is implicitly mapped to target= rx.cond(True, "_blank", "")
. Issue is with the cond statement which is surprising.
If you modify your code to
...
rx.link(
href=url,
target=rx.cond(True, "_blank", "_self"),
),
You'd see that it doesn't render the hovercard either. Will investigate this
Describe the bug
When using
is_external=True
in anrx.link
inside components such ashover_card
andtooltip
, the component fails to render. However, replacingis_external=True
withtarget="_blank"
allows the component to render correctly, enabling the link to open in a new tab as expected. The Reflex documentation recommendsis_external=True
as a modern replacement fortarget="_blank"
, yet this implementation leads to rendering issues in advanced components, whiletarget="_blank"
works as intended.To Reproduce
is_external=True
on anrx.link
insidehover_card
.is_external=True
withtarget="_blank"
as shown in the Functional Code Example below.Code/Link to Repo
Bug Code Example (
is_external=True
)Functional Code Example (
target="_blank"
)Expected behavior
The expected behavior is for
is_external=True
to render the component astarget="_blank"
does, without causing any rendering issues.Screenshots
Please see the attached screenshots showing:
The error when using
is_external=True
The successful rendering using
target="_blank"
Specifics:
Additional context
This issue appears when using
is_external=True
inhover_card
ortooltip
. Reflex documentation encourages the use ofis_external=True
as a best practice, but the current implementation is not functional in these specific components.