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.

[Tooltip] onFocus does not work on TextField if using a Tooltip with it

See original GitHub issue
  • 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:

  1. Add a TextField to let user input something.
  2. Bind an onFocus function to the TextField. -> The function works well.
  3. Add a Tooltip to the TextField to show some hint for user. -> The onFocus function 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: https://github.com/mui-org/material-ui/commit/c98b9c47c5df2c94a72d5ce2b5169c1c53a1d842

Your Environment 🌎

Tech Version
Material-UI v4.9.4
React v16.13.0
Browser Chrome 80

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:13 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
oliviertassinaricommented, Mar 15, 2020

@netochaves “good first issues” are meant to ramp up new contributors, given you have already done a none negligible number of contributions, I think that it would be better to focus on harder issues. Thanks

1reaction
eps1loncommented, Mar 1, 2020

@sudoStatus200 I think we should look at disableFocusListener after the proposed changes. Might be that disableFocusListener just affects the symptoms but doesn’t have to do anything with the cause of the issue.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Tooltip] onFocus does not work on TextField if using ... - GitHub
The issue is present in the latest release. I have searched the issues of this repository and believe that this is not a...
Read more >
angularjs - Popping a tooltip on focus when you can't add the ...
I have a field directive with an isolate scope that covers the input and the label associated with it, so that is the...
Read more >
Showing jQuery UI tooltip on focus of text box
To that end, I created the following code that shows and hides the tooltip when the user clicks into/out of the textbox: $(function...
Read more >
Tooltip | Components - BootstrapVue
Easily add tooltips to elements or components via the component or v-b-tooltip directive.
Read more >
ARIA Tooltip Example - Accessibility at Athena ICT
The tooltip never receives focus. Focus stays on the textbox. The tooltip widget can shown via keyboard focus or by the onmouse event....
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