-
-
Notifications
You must be signed in to change notification settings - Fork 32.7k
Closed
Labels
good first issueGreat for first contributions. Enable to learn the contribution process.Great for first contributions. Enable to learn the contribution process.scope: tooltipChanges related to the tooltip.Changes related to the tooltip.type: bugIt doesn't behave as expected.It doesn't behave as expected.
Description
- The issue is present in the latest release.
- I have searched the issues of this repository and believe that this is not a duplicate.
Current Behavior 😯
onFocus does not work if using a Tooltip with TextField:
<Tooltip title="Some hint">
<TextField onFocus={() => {console.log("This cannot work!")}} />
</Tooltip>
This problem does not exist in Material-UI version <=4.7.1
Expected Behavior 🤔
onFocus can work when using a Tooltip.
Steps to Reproduce 🕹
https://codesandbox.io/s/modest-proskuriakova-z9sob
Steps:
- Add a
TextFieldto let user input something. - Bind an
onFocusfunction to theTextField.
-> The function works well. - Add a
Tooltipto theTextFieldto show some hint for user.
-> TheonFocusfunction does not work any more.
Context 🔦
I found this issue after I upgrade Material-UI to latest version. Now I have to use native input instead of TextField to avoid this problem.
Please correct me if I'm using the component wrongly. Thanks in advance!
Checked the source code, I think the problem is caused by this commit: c98b9c4
Your Environment 🌎
| Tech | Version |
|---|---|
| Material-UI | v4.9.4 |
| React | v16.13.0 |
| Browser | Chrome 80 |
Metadata
Metadata
Assignees
Labels
good first issueGreat for first contributions. Enable to learn the contribution process.Great for first contributions. Enable to learn the contribution process.scope: tooltipChanges related to the tooltip.Changes related to the tooltip.type: bugIt doesn't behave as expected.It doesn't behave as expected.