Popup won't open when inside disabled FormField
See original GitHub issueMy use case is that I use Popup component to display a small information text about fields inside a form. Sometimes those fields are disabled (because the user is not allowed to change them at the moment). That does not mean the information is not valuable to the user. Please fix so that Popup always opens, even though field is disabled.
Field with info Disabled field won’t show info
Steps
- Create info popup inside form field
- Disable the field
Expected Result
Popup opens on mouse hover
Actual Result
Popup does not open on mouse hover (when form field is disabled.)
Version
0.66.0
Testcase
The code is very simple (rewrote code from the docs):
import React from 'react'
import { Button, Checkbox, Form, Popup, Icon } from 'semantic-ui-react'
const FormExampleForm = () => (
<Form>
<Form.Field disabled>
<label>First Name <Popup trigger={<Icon name="question" circular size="small" inverted/>} content="Some info here" /> </label>
<input placeholder='First Name' disabled/>
</Form.Field>
<Button type='submit'>Submit</Button>
</Form>
)
export default FormExampleForm
Thank you for an amazing library!
Issue Analytics
- State:
- Created 7 years ago
- Reactions:3
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Clicking a disabled input or button - javascript - Stack Overflow
Any event that starts at the disabled form field is completely canceled and does not propagate up the DOM tree. Correct me if...
Read more >How to disable or enable buttons using Javascript and jQuery
Learn how to enable or disable buttons using javascript and jQuery based on whether the input field is filled or empty.
Read more >Pop-ups do not display the attribute information in ArcGIS Pro
Display the Fields element in the feature pop-up. Open the ArcGIS Pro project, and click any feature on the map to display the...
Read more >Forms - Bootstrap
Disabled checkboxes and radios are supported. The disabled attribute will apply a lighter color to help indicate the input's state. Checkboxes and radio...
Read more >Creating a promotional pop-up - Squarespace Help Center
Trigger a new subscribers form, share a discount, ... You can't have a pop-up on pages within a member area, or on Index...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
To achieve this I just wrapped the button in a
<span>
, like so:Closing as the suggestion to change the disabling of pointer events will resolve the issue if anyone wants to do override what is default in specific cases. I would not recommend adding a
<span />
as this will in a number of ways break the CSS due to how SUI class names are built for specificity with specific markup and direct child selectors.