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

Form Select "size" prop conflict with native size attr #761

Closed
r4fx opened this Issue Aug 1, 2017 · 5 comments

Comments

Projects
None yet
3 participants
@r4fx

r4fx commented Aug 1, 2017

In b-form-select there is no possibility to use native HTML5 size attribute, because of prop with the same name, so please consider to change the name for size property to something different to enable use of size attribute. Thanks!

<select size="3">
  <option value="volvo">Volvo</option>
  <option value="saab">Saab</option>
  <option value="opel">Opel</option>
  <option value="audi">Audi</option>
</select>

See how native attr size work
https://www.w3schools.com/Tags/tryit.asp?filename=tryhtml_select_size

@tmorehouse

This comment has been minimized.

Member

tmorehouse commented Aug 1, 2017

Currently b-form-select does not support the multiple attribute (neither does Bootstrap V4's custom select) which allows you to take advantage of the size attribute.

There is a PR #731 that introduces multiple select support, and also introduces the multiple-size property, which will set the size attribute on the select (and also removes custom styling from the select).

This PR has been merged. and will be available in v0.19.0 which should be released in the near future.

Although this PR only adds the native size attribute when the select is in multiple mode.

@tmorehouse

This comment has been minimized.

Member

tmorehouse commented Aug 1, 2017

As a side note, the prop size is used by many of the BootstrapVue components to control the Bootstrap V4 form-control/button sizes.

@r4fx

This comment has been minimized.

r4fx commented Aug 1, 2017

yeah I seen this PR, but as you mentioned this will cover only dropdown with multiple mode,
there will not be an option to use size attribute in single mode. This is maybe a rare case to use it (as in my case) but i think there should be a possibility to use such native attr.

tmorehouse added a commit that referenced this issue Aug 1, 2017

feat(form-select): Allow selectSize to be set when not in multiple mo…
…de (Issue #761) (#762)

* [form-select] Allow select-size to be set when not in multiple mode

Allows the select native `size` attribute to be set (via the prop `select-size`), even when not in multiple mode.  Only has any effect when `select-size > 1`.  custom select styling is removed when in `multiple` mode or `select-size > 1`.

Changes `multiple-size` attribute to `select-size` (`multiple-size` was not available in v0.18.0, so deprecation is not needed)

* [form-select] update documentation
@tmorehouse

This comment has been minimized.

Member

tmorehouse commented Aug 1, 2017

New merged PR #762 should address the issue to allow select-size to be set when not in multiple mode. setting select-size to a value greater than 1 will trigger list-box mode.

@Sobient

This comment has been minimized.

Sobient commented Aug 8, 2017

Avoid using W3Schools as a reference.

Here is a proper documentation: https://developer.mozilla.org/en/docs/Web/HTML/Element/select

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