Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.Sign up
Fix modals in react #11714
Need to do it in a timeout because ng-react hasn’t loaded the react
Added tests which would have caught the issue, but also ended up switching the default button for deleting dashboards since it should be the non-destructive option by default.
I agree it's hacky @ycombinator, unfortunately I couldn't come up with any other solution. I also couldn't find any approved pattern for this type of thing, with ng-react. The timeout just happened to work.
I added a comment, mentioning the limitations of the solution. If you have any other ideas, I'm open to exploring them. @weltenwort -- since you have some more experience with ng-react, have you ever come across this type of situation before, and maybe have a better solution?
Focus management in React is not an easy topic, because setting the focus is a document-global effect and as such not covered by the React API.
I guess this cannot be achieved using the html
If you allow for an additional comment, the current use of
(For completely redux-based apps I would treat focus management as a side-effect in a middleware.)
May 15, 2017
@stacey-gammon I was reading https://facebook.github.io/react/docs/refs-and-the-dom.html to understand
Since you are adding a
I think what that means is that I can use ref inside of a functional component e.g. this:
but I still can't do this:
Without making KuiButton a class. In the second example,
So, I investigated autofocus a little more as an option because of the comments in this PR: #10925. It's supported in all the browsers we support, just not a couple mobile browsers, in which case, it's really not that important because the user needs to use the touch screen to press the right button anyway.