question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add the ability to hide a Form Item

See original GitHub issue
  • I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

It would be nice to be able to toggle the visibility of a form item by toggling a boolean flag, such as hidden. By default the value would be false, meaning that is is not hidden.

This would prevent having to wrap the component within an if statement to deduce whether or not the component is visible.

What does the proposed API look like?

By default, all form items should be visible, e.g:

<Form.Item label="Username">
    <Input type="text" />
</Form.Item>

Setting the hidden prop to true, would hide the form item, e.g:

<Form.Item label="Username" hidden={true}>
    <Input type="text" />
</Form.Item>

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

64reactions
yoyo837commented, Dec 3, 2019

掩耳盗铃,隐藏和没有是两回事

20reactions
henryzpcommented, May 14, 2020

@yoyo837

<Form.Item label="Username" noStyle>
    <Input type="text" type="hidden" />
</Form.Item>
Read more comments on GitHub >

github_iconTop Results From Across the Web

Toggle visibility in Antd form - reactjs - Stack Overflow
You can use css property display: none , to hide Input fields on certain condition. e.g you can use condition ( vital being...
Read more >
How to Hide Form Fields Based Upon User Selection - Solodev
Hiding certain form fields until a user triggers them with a previous answer can be a simple way to withhold certain questions until...
Read more >
Form - Ant Design
High performance Form component with data scope management. ... Add or remove form items dynamically. add function support config initial value. expand code....
Read more >
<input type="hidden"> - HTML: HyperText Markup Language
The <input> element's value attribute holds a string that contains the hidden data you want to include when the form is submitted to...
Read more >
Use JavaScript to Hide or Show a Portion of a Form - YouTube
Use a JavaScript IF Statement to hide the shipping part of an order form if it is the same as the billing part...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found