Quasar: qselect options with '<>' is not rendered as text

Created on 29 Jun 2020  ·  2Comments  ·  Source: quasarframework/quasar

Describe the bug
If I specify an option in '<' and '>', it is not rendered as text.

To Reproduce
Steps to reproduce the behavior:

  1. For q-slect define options as:
    options: [ 'Google', '<Facebook>', 'Twitter', 'Apple', 'Oracle' ]
  2. Click on Select for drop down options
  3. Notice the option blank

Expected behavior
Instead of blank, it should be <Facebook>

Screenshots
image

System

  • Quasar Version: 1.9.13 (and latest too)
bug

Most helpful comment

Thanks! I was about to update with that answer. should have gone through the docs in more details. 🤦‍♂️

All 2 comments

The content you have is essentially a HTML tag so it's being parsed.

Add: :options-sanitize="true".

Force use of textContent instead of innerHTML to render options; Use it when the options might be unsafe (from user input); Does NOT apply when using 'option' slot!

https://quasar.dev/vue-components/select#QSelect-API

Thanks! I was about to update with that answer. should have gone through the docs in more details. 🤦‍♂️

Was this page helpful?
0 / 5 - 0 ratings