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

Unable to set html size attribute on <FormControl as="select"> #4499

Closed
twheys opened this issue Sep 20, 2019 · 10 comments
Closed

Unable to set html size attribute on <FormControl as="select"> #4499

twheys opened this issue Sep 20, 2019 · 10 comments

Comments

@twheys
Copy link

twheys commented Sep 20, 2019

Describe the bug

The prop size on FormControl does not get set on the html element when using as="select. It is possible to set multiple="true" and use css to set the height, but it is not possible to have a single select that displays the options as a list rather than a dropdown.

https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#attr-size

To Reproduce

Reproducible Example

https://codesandbox.io/embed/condescending-surf-dvtyr

Expected behavior

The size attribute be passed to the html select element changing the behavior to a multi-line single value select

Environment (please complete the following information)

  • Operating System: [e.g. macOS]
  • Browser, Version [e.g. Chrome 74]
  • React-Bootstrap Version [e.g. 1.0.0-beta.8]
@bpas247
Copy link
Member

bpas247 commented Sep 27, 2019

That CodeSandbox link looks like a generic vanilla sandbox setup, could you please update it to showcase the issue?

@artygrand
Copy link

Still nothing fixed?

This 'size' cannot be passed
https://www.w3schools.com/tags/tryit.asp?filename=tryhtml_select_size

@kosmiq
Copy link
Collaborator

kosmiq commented Apr 26, 2020

You're welcome to create a pr fixing this. I do not know however how we would handle it with custom-select and the size prop that's already in use (never mind that the styling doesn't exist for this use case I think).

@artygrand
Copy link

artygrand commented Apr 28, 2020

I cannot fix it by myself, I just started using react. Maybe selectSize or htmlSize should be translated to native size?

@kosmiq
Copy link
Collaborator

kosmiq commented Apr 28, 2020

@jquense @taion I guess we should support this. It works with TWBS: https://codesandbox.io/s/nifty-kapitsa-qfrhx?file=/index.html

Do we call it htmlSize as suggested or something else?

@jquense
Copy link
Member

jquense commented Apr 28, 2020

htmlSize is fine yeah

@Exxenoz
Copy link
Contributor

Exxenoz commented May 4, 2020

I need this feature for a project. Would be glad if I don't have to create a hacky workaround. htmlSize sounds just fine. 👍 😄

@jquense
Copy link
Member

jquense commented May 4, 2020

PR's welcome!

@kosmiq
Copy link
Collaborator

kosmiq commented May 4, 2020

Yeah I haven't had as much time as I thought. I might be able to fix it later this week but we'll see.

Otherwise please do create a pr for it :)

@kyletsang
Copy link
Member

Closing since htmlSize was already added

https://react-bootstrap.github.io/components/forms/#forms-custom-select

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

No branches or pull requests

7 participants