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

Feature: props.toggle should receive the event object from the event that triggered it #1094

Closed
juanmaguitar opened this issue Jun 26, 2018 · 0 comments · Fixed by #1105
Closed

Comments

@juanmaguitar
Copy link
Contributor

Issue description

  • components: Tooltip
  • reactstrap version 6.1.0

What is happening?

The current implementation of toggle in the Tooltip component doesn't allow to have access to the event object from a custom toggle (custom handler passed through props)

toggle(e) {
    if (this.props.disabled) {
      return e && e.preventDefault();
    }

    return this.props.toggle();
  }

The this.props.toggle() is not called with the e object which will give access to the event property from the custom handler (to decide for example what to do depending on the type of the event that triggered this toggle)
And although is prepared to receive the event object (e) is not called with this data in almost any of the calls.

What should be happening?

The props.toggle should be called with the e object

toggle(e) {
    if (this.props.disabled) {
      return e && e.preventDefault();
    }

    return this.props.toggle(e);
  }
TheSharpieOne pushed a commit that referenced this issue Jun 26, 2018
This PR is related to the issue #1094 
It also allows the developer to extend the capabilities of Tooltip to solve this another issue: #1072
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 a pull request may close this issue.

1 participant