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

b-form-tags input type is always text #4644

Closed

Comments

@bezumkin
Copy link

bezumkin commented Jan 17, 2020

Describe the bug

Looks like input type of b-form-tags is hardcoded to text. I can't change it via input-props.

Expected behavior

input-props should have ability to change type.

Versions

Libraries:

  • BootstrapVue: 2.2.2
  • Bootstrap: 4.4.1
  • Vue: 2.6.11

Environment:

  • Device: Mac
  • OS: macOS Mojave
  • Browser: Chrome
  • Version: 79.0.3945.117
@tmorehouse
Copy link
Member

tmorehouse commented Jan 17, 2020

As stated in the docs:

https://bootstrap-vue.org/docs/components/form-tags#form-tags

Tags are arrays of short strings, used in various ways such as assigning categories.

What types of inputs are you looking for?

@tmorehouse
Copy link
Member

tmorehouse commented Jan 17, 2020

If you need, say a type number, then you can use the scoped default slot to provide your own custom interface (https://bootstrap-vue.org/docs/components/form-tags#custom-rendering-with-default-scoped-slot).

Note that different types may use different events (or multiple events), i.e. number inputs may trigger on change (if using the spin buttons) instead of input.

To emulate say a number input, you can pass a pattern attribute pattern="/^[0-9]+$/"

@bezumkin
Copy link
Author

What types of inputs are you looking for?

email, time, url - they are strings but I can't use them now

then you can use the scoped default slot to provide your own custom interface

Of course I can do this, but I don't want to repeat the whole component only for changing input type.

@tmorehouse
Copy link
Member

email, url, tel, and possibly number, we should be able to do. date and time may be difficult since their behaviour changes due to varied support on different browsers (keydown.enter isn't always available)

tmorehouse added a commit that referenced this issue Jan 22, 2020
…4645)

Co-authored-by: Jacob Müller <jacob.mueller.elz@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment