Skip to content

[Table] Send event object after click, hover, hoverOut on cell.#3002

Merged
oliviertassinari merged 1 commit into
mui:masterfrom
MaronMariusz:Table-onCellEventObject
Feb 5, 2016
Merged

[Table] Send event object after click, hover, hoverOut on cell.#3002
oliviertassinari merged 1 commit into
mui:masterfrom
MaronMariusz:Table-onCellEventObject

Conversation

@MaronMariusz

Copy link
Copy Markdown
Contributor

Since I couldn't find onClick event on my table I made something own. If you like it, merge it ;) Cheers!

(if you have some solution to make this PR useless let me know!)

  • modified: src/table/table-body.jsx
  • modified: src/table/table.jsx

@oliviertassinari

Copy link
Copy Markdown
Member

@MaronMariusz That sounds like a good idea to propagate the event object.

Comment thread src/table/table-body.jsx Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think that it would be better to use event instead of e.

That would also be good to have the event as the first argument. However, using event as the first parameters would introduce a breaking change.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Hi, thanks for reply.

event instead of e sounds better you are right, but what I have seen in this component author used just e as variable name so I wanted to keep with this idea.

Moreover I agree that moving this param on the first place can break something so that's why I pushed it as the last item ;)

Personally it helps me so much in order to make some event delegations :)

Cheers!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

what I have seen in this component author used just e as variable name so I wanted to keep with this idea.

I understand, we are slowing rolling out from e to event.

Moreover I agree that moving this param on the first place can break something so that's why I pushed it as the last item ;)

Don't do it in this PR. That would be a breaking change.

@oliviertassinari

Copy link
Copy Markdown
Member

@MaronMariusz Could you take into account my comments? I think that we can merge this PR then.

	modified:   src/table/table-body.jsx
	modified:   src/table/table.jsx
@MaronMariusz
MaronMariusz force-pushed the Table-onCellEventObject branch from 2bed696 to 118efbe Compare February 5, 2016 19:50
@MaronMariusz

Copy link
Copy Markdown
Contributor Author

Hi, I changed e to event and we can :shipit:

@oliviertassinari

Copy link
Copy Markdown
Member

@MaronMariusz That looks good, thanks!
However, expect the argument order to change in future release, we will try to stay coherent and to keep event as the first parameter (#2957).

oliviertassinari added a commit that referenced this pull request Feb 5, 2016
[Table] Send event object after click, hover, hoverOut on cell.
@oliviertassinari
oliviertassinari merged commit a972c92 into mui:master Feb 5, 2016
@zannager zannager added the scope: table Changes related to the table. label Mar 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

scope: table Changes related to the table.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants