Skip to content

Hidden rx.input is not properly hidden #6874

Description

@luator

Describe the bug
Input fields of type "hidden" (rx.input(type="hidden")) still appear on the page as a weird vertical bar. Additionally setting hidden=True doesn't help either.

Inspecting the generated HTML, it seems the problem is a div around the input which has some styling that makes it visible.

To Reproduce
Create a minimal package using reflex init and replace the index() function with this:

def index() -> rx.Component:
    return rx.container(
        rx.vstack(
            rx.text("Hidden input example start"),
            rx.input(type="hidden", value="foo"),
            rx.input(type="hidden", value="foo", hidden=True),
            rx.text("Hidden input example end"),
        ),
    )

Expected behavior
Nothing shows up between the two lines of text:

Image

Actual behaviour

Image

Specifics (please complete the following information):

  • Python Version: 3.14
  • Reflex Version: 0.9.8
  • OS: Linux (Ubuntu 24.04
  • Browser (Optional): Tested with Vivaldi and Firefox

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions