Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Allow all events to be attached to the inner iFrame#3

Merged
developit merged 3 commits intodevelopit:masterfrom
pl12133:feature/proxy-all-events
Jun 15, 2017
Merged

Allow all events to be attached to the inner iFrame#3
developit merged 3 commits intodevelopit:masterfrom
pl12133:feature/proxy-all-events

Conversation

@pl12133
Copy link

@pl12133 pl12133 commented Jun 8, 2017

I would like to have the frame of the <RichTextArea> be able to accept any event handler, in order to do things like handle the drop event for enabling drag/drop.

I also want to pass the entire event object on when calling event handlers.

Let me know if these seem like disruptive changes, or if I am missing something about attaching handlers to the inner frame. Thanks!

pl12133 added 2 commits June 7, 2017 19:13
…Area>.

Pass the entire event object to event handlers in `handleEvent`.
Use `partitionEventHandlers` to delete event handlers from props.
export default function partitionEventHandlers({ ...props }, withOrWithout) {
let key;
for (key in props) if (props.hasOwnProperty(key)) {
if (/^on/i.test(key) ^ withOrWithout === true) {
Copy link
Owner

@developit developit Jun 15, 2017

Choose a reason for hiding this comment

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

almost too clever ;)

might be worth building up the returned props here instead of cloning and deleting, would be better for perf

Copy link
Author

Choose a reason for hiding this comment

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

Sounds good, switched over to accumulating instead of clone + deleting.

@developit developit merged commit e064848 into developit:master Jun 15, 2017
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.

2 participants