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

[Input] Dodge the BFcache issue #8110

Merged
merged 1 commit into from Sep 9, 2017

Conversation

rosskevin
Copy link
Member

As-is, the code on v1-beta is broken for users based on a hack for SSR.

I did some research, and successfully simulate the change in the browser.

@oliviertassinari this works in the browser, but it fails with mocha testing. Since I've gotten it this far (and I don't use SSR), I would appreciate if you picked this up and figured out the mocha dom Event compatibility issue and make sure it is SSR compatible for you.

I also more strongly typed the event signatures.

/reference https://stackoverflow.com/a/31056122/2363935

@rosskevin rosskevin added bug 🐛 Something doesn't work v1 labels Sep 8, 2017
/**
* @ignore
*/
onFocus?: Function,
onFocus?: (event: SyntheticUIEvent<>) => void,
Copy link
Member

Choose a reason for hiding this comment

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

Focus event?

/**
* @ignore
*/
onKeyDown?: Function,
onKeyDown?: (event: SyntheticUIEvent<>) => void,
Copy link
Member

Choose a reason for hiding this comment

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

Keyboard event?

@rosskevin
Copy link
Member Author

FYI - I just figured out this change is not compatible with a custom inputComponent, which is another big problem.

const event = new Event('input', {
bubbles: true,
});
this.input.dispatchEvent(event);
Copy link
Member

Choose a reason for hiding this comment

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

I have just tried it, it doesn't work. I'm looking into it.

@oliviertassinari
Copy link
Member

I have opened an issue on the React side facebook/react#10657. Let's dodge the issue for now 👼 .

@oliviertassinari oliviertassinari changed the title [Input] incomplete mock event hash fired is breaking other libraries [Input] Dodge the BFcache issue Sep 9, 2017
@oliviertassinari oliviertassinari added component: select This is the name of the generic UI component, not the React module! component: text field This is the name of the generic UI component, not the React module! PR: accepted labels Sep 9, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🐛 Something doesn't work component: select This is the name of the generic UI component, not the React module! component: text field This is the name of the generic UI component, not the React module!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants