customize MDB Select label by supporting html content


Topic: customize MDB Select label by supporting html content

Nicolas Tsue - Orbit Coins pro asked 6 years ago

Expected behavior

hi i want to make select box option accepts a html element to display instead of plan text.

so this code:

this.optionsSelect = [
{ value: '1', label: '<b>Option 1</b> is bold' },
{ value: '2', label: '<i>Option 2</i> is italic' },
];

should render:

'<b>Option 1</b> is bold' ==(should render)==> Option 1 is bold
'<i>Option 2</i> is italic' ==(should render)==> Option 2 is italic

Actual behavior

the same previous code is rendering:

'<b>Option 1</b> is bold' ==(is rendering)==> Option 1 is bold
'<i>Option 2</i> is italic' ==(is rendering)==> Option 2 is italic

Resources (screenshots, code snippets etc.)

these links shows differences with and without html code.

https://ibb.co/gMRMCSY
https://ibb.co/r7QQH08


Arkadiusz Idzikowski staff answered 6 years ago

Unfortunately, it won't work in the current version of mdb-select. We will take a closer look at this problem.

Mdb-select is a premium component, and according to our system, you use MDB Free version.

Please, provide us a number o your order or registered email to confirm your access to MDB Pro components and premium support. You can send it to me on a.idzikowski@mdbootstrap.com


Please insert min. 20 characters.

FREE CONSULTATION

Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.

Status

Answered

Specification of the issue
  • User: Pro
  • Premium support: No
  • Technology: MDB Angular
  • MDB Version: 7.4.3
  • Device: AS
  • Browser: Chrome
  • OS: Windows 10
  • Provided sample code: No
  • Provided link: Yes