Skip to content

hover_card doesn't work when the trigger is an rx.memo'd component #5042

@SheldonHolmgren

Description

@SheldonHolmgren

To Reproduce
This works:

@rx.page(route="/test_hover/")
def test_hover():
    return rx.hover_card.root(
        rx.hover_card.trigger(
            rx.text("hover me")
        ),
        rx.hover_card.content(
            rx.text("Hello, world!")
        )
    )

But this doesn't (nothing happens when the trigger is hovered over):

@rx.memo
def hover_trigger():
            return rx.text("hover me")

@rx.page(route="/test_hover/")
def test_hover():
    return rx.hover_card.root(
        rx.hover_card.trigger(
            hover_trigger()
        ),
        rx.hover_card.content(
            rx.text("Hello, world!")
        )
    )

Edit: It works again if I remove the @rx.memo decorator.

Expected behavior
Both code snippets should work the same.

Specifics (please complete the following information):

  • Python Version: 3.10.15
  • Reflex Version: 0.7.2

Additional context
The workaround from another issue #3278 (comment) doesn't work here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions