Skip to content

Conversation

ssi114
Copy link

@ssi114 ssi114 commented Mar 15, 2019

No description provided.

@vinodloha
Copy link
Collaborator

@ssi114 Can you check why CI build is failing and fix it?

Copy link
Collaborator

@vinodloha vinodloha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<span className={className} onMouseLeave={this.hideTooltip}>
{displayTooltip && (
<div className={classNames('tooltip-bubble', position)}>
<div className="tooltip-message">{message}</div>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ssi114 i would expect tool tip to get triggered from existing components like Button

Copy link
Collaborator

@vinodloha vinodloha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ssi114 Please fix these review comments.


class Tooltip extends Component<Props, State> {
static defaultProps = {
message: '',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This Props will not be string.

this.setState({ displayTooltip: true });
};

render() {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should use react portal so that tooltip doesn't get cropped because of overflow hidden on parent.

TooltipComponent = shallow(<Tooltip>Test</Tooltip>);
});

test('should render correctly', () => {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This test will not be enough

Copy link
Collaborator

@vinodloha vinodloha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are still lot of things to fix @ssi114

import styles from './Tooltip.style';
import type { Props, State } from './types';

class Tooltip extends Component<Props, State> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ssi114 this component can be PureComponent and not a Component

};

componentDidMount() {
document.addEventListener('keyup', (e: KeyboardEvent) => {
Copy link
Collaborator

@vinodloha vinodloha Apr 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keyup event should change to keydown and event type could be KeyboardEvent use SyntheticEvent instead it will cover both Mouse and Keyboard

</div>
)}
<span className="tooltip-trigger" role={ariaRole}>
{children}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Children should be body of tooltip and not the trigger

@sohonisaurabh
Copy link

@vinodloha I am picking up this task

@vinodloha vinodloha closed this Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants