Skip to content

Ability to render Touchable as <button> on web #847

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

Closed
kirill-kruchkov opened this issue Mar 2, 2018 · 4 comments
Closed

Ability to render Touchable as <button> on web #847

kirill-kruchkov opened this issue Mar 2, 2018 · 4 comments

Comments

@kirill-kruchkov
Copy link

kirill-kruchkov commented Mar 2, 2018

A bug

Button and Touchable components render as <div>s though from #391 I can see that if accessibilityRole=button then it should render as <button>.

Demo repo
https://github.com/kirill-kruchkov/react-native-web-button-demo (please see TouchableHighlight usage in src/Home.js).

What is the expected behavior?
Render Touchables with accessibilityRole=button as <button> on web.

@dcalhoun
Copy link
Contributor

dcalhoun commented Mar 2, 2018

Note: The button role is not implemented using the native button element due to browsers limiting the use of flexbox layout on its children.

This is an intentional decision referenced in the documentation.

@kirill-kruchkov
Copy link
Author

@dcalhoun thank you, missed that part

@efoken
Copy link

efoken commented Oct 18, 2020

@kirill-kruchkov @dcalhoun I would like to re-open this issue. It would be really nice, if we have the ability to render i.e. <button> elements with type="submit".

There is a workaround for the flexbox issue with the <button> element according to Flexbug #9 and some browsers are already fixed.

@dcalhoun
Copy link
Contributor

@efoken I'd recommend opening a new issue specifically outlining the details behind your need for a <button type="submit" />. It's more likely that the project maintainer would weigh in on a new issue.

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

No branches or pull requests

3 participants