Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Tooltip] steals focus when shown #2057

Closed
1 of 2 tasks
d-akara opened this issue Feb 22, 2021 · 2 comments
Closed
1 of 2 tasks

[Tooltip] steals focus when shown #2057

d-akara opened this issue Feb 22, 2021 · 2 comments

Comments

@d-akara
Copy link

d-akara commented Feb 22, 2021

What package is this for?

  • React
  • Angular

Describe the bug

Tooltip steal focus when shown.

To Reproduce

Steps to reproduce the behavior:

  1. Create an input field which triggers a Tooltip on typing.
  2. Attempt to type in the entry field
  3. The tooltip will steal the focus preventing typing in the input field

Please create a reduced test case in CodeSandbox:
https://codesandbox.io/s/github/IBM/carbon-addons-iot-react/tree/master/examples/codesandbox

import React from 'react';
import {useState} from "react";
import { render } from 'react-dom';
import {Tooltip, Search} from "carbon-components-react";
import 'carbon-addons-iot-react/css/carbon-addons-iot-react.css';

const App = () => {
  const [showTooltip, setShowTooltip] = useState(false)
  return (
    <>
      <Search size={"sm"}
              onChange={()=> setShowTooltip(true)}
              placeHolderText={"type here to lose focus"}
      />
      <Tooltip
          tabIndex={-1}
          showIcon={false}
          open={showTooltip}>
          I'm stealing the focus
      </Tooltip>
    </>
)};

render(<App />, document.getElementById('root'));
export default App;

Expected behavior

Showing the tooltip should not prevent typing into the input field.

Environment/versions:

  • OS: MacOS, Windows
  • Browser: firefox, chrome
  • carbon-addons-iot-react version: [v2.142.0]

Additional context

This issue seems to be caused by carbon-design-system/carbon#6719
Which appears to be fixed starting with carbon v10.21.0 carbon-design-system/carbon@225f212

Specific timeline issues / requests

This is a Major issue in the ELM people picker. See - https://jazz.net/jazz/web/projects/Jazz%20Foundation#action=com.ibm.team.workitem.viewWorkItem&id=528119

We need a fix for ELM 7.0.3 by Sprint 6/7 (April/May) time frame.

@davidicus
Copy link
Collaborator

Hi @d-akara. It looks like this problem has already been resolved in the Carbon library. I have opened an issue to upgrade our Carbon version in order to pull in these changes. This issue has been added to our March sprint.

@davidicus
Copy link
Collaborator

This issue should be closed with the above Carbon upgrades. Closing but feel free to re open if issue persist for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants