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

[Switch] autoFocus #12179

Closed
Mangatt opened this issue Jul 18, 2018 · 2 comments
Closed

[Switch] autoFocus #12179

Mangatt opened this issue Jul 18, 2018 · 2 comments
Labels
component: switch This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. new feature New feature or request

Comments

@Mangatt
Copy link
Contributor

Mangatt commented Jul 18, 2018

There is problem with Switch component autoFocus (Material UI 1.4.0):

<Switch
	inputProps={{
		autoFocus: true
	}}
/>

Although input is correctly focused in browser (and switching with space key works), component focus is not highlighted.

For autoFocusing element, there should probably be autoFocus property on Switch component:

<Switch autoFocus />

And I guess that focused styling on unchecked element should be changed - white glow in light theme is practically invisible.

@Mangatt
Copy link
Contributor Author

Mangatt commented Jul 18, 2018

<Switch required />

Should probably pass required attribute to input element as well.

@Mangatt Mangatt changed the title Switch autoFocus [Switch] autoFocus Jul 18, 2018
@oliviertassinari oliviertassinari added new feature New feature or request component: switch This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. labels Jul 18, 2018
@oliviertassinari
Copy link
Member

@Mangatt I agree, I think that we should be using the same tradeoff between Switch, Radio, Checkbox and the Input. The properties that we should forward but we miss in the SwitchBase component:

  • autoFocus
  • readOnly
  • required

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: switch This is the name of the generic UI component, not the React module! good first issue Great for first contributions. Enable to learn the contribution process. new feature New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants