Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Clicking space on a checkbox button #4474

Closed
Foxandxss opened this issue Sep 25, 2015 · 9 comments
Closed

Clicking space on a checkbox button #4474

Foxandxss opened this issue Sep 25, 2015 · 9 comments

Comments

@Foxandxss
Copy link
Contributor

There is code to toggle a checkbutton with space. If you go to the demo and do it, it will toggle twice. I haven't checked it yet so I open this issue to not forget.

@wesleycho
Copy link
Contributor

I implemented it for accessibility reasons originally.

@Foxandxss
Copy link
Contributor Author

Yes, but I don't think it should trigger the toggling twice, right?

@wesleycho
Copy link
Contributor

No, that's a bug then. I just mentioned it for context.

@wesleycho wesleycho added this to the 0.14.0 (Bootstrap 3.3) milestone Sep 26, 2015
@Foxandxss
Copy link
Contributor Author

Wes, I checked and basically the PR you made to add accessibility is not needed. It works without it. I am not completely sure if it works nice with screenreaders and stuff, but a button is always clickable with space.

The thing is, I would like to leave the test, but the keypress event won't work. I am not sure if under the hood the space counts as a click instead of keypress.

Thoughts?

@wesleycho
Copy link
Contributor

Hm, maybe I was mistaken in my attempt to fix it.

That sounds good - as long as we have a test around it and this is fixed, I'm all for it.

@Foxandxss
Copy link
Contributor Author

Yeah, but test how. I have no idea because I don't know how does this work behind the scenes. Is the space on a button considered a click? If so, how to test that?

@wesleycho
Copy link
Contributor

It just needs to behave like a click and toggle the button model

@Foxandxss
Copy link
Contributor Author

And it does my friend and it does, but no idea how to test that in a special way.

@wesleycho
Copy link
Contributor

The pre-existing test may be fine

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants