Topic: Issue with double quotes in Select field

LTMG01 free asked 5 years ago


Hi,

I am encountering an issue with a select form field that contains measurements in inches (depicted as a double quotation character). When there are double quotes in an item label (either entered as " or "), and that item is the default select, then the MDB element displays " instead of the double quote mark.

Please see this code snippet 

Any solution for this problem would be highly appreciated.


LTMG01 free answered 5 years ago


I have actually found another, possibly better solution for this myself, by changing line 20,470 in the mdb.js file from:

var sanitizedLabelHtml = this.$materialSelectInitialOption.replace(/"/g, '"');

to

var sanitizedLabelHtml = this.$materialSelectInitialOption;

 

Can you confirm that this change would not affect any of the other functionality of the select from field? It doesn't seem like it would.


Bartłomiej Malanowski staff commented 5 years ago

This shouldn't break anything in your Material Select


Sebastian Kaczmarek staff answered 5 years ago


Ok, it seems like a bug. We'll fix that. As a temporary workaround, you can use double single-quote and it'll be displayed properly.


LTMG01 free commented 5 years ago

I have actually found another, possibly better solution for this myself, by changing line 20,470 in the mdb.js file from:

var sanitizedLabelHtml = this.$materialSelectInitialOption.replace(/"/g, '"');

to

var sanitizedLabelHtml = this.$materialSelectInitialOption;

 

Can you confirm that this change would not affect any of the other functionality of the select from field? It doesn't seem like it would.



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

  • ForumUser: Free
  • Premium support: No
  • Technology: MDB jQuery
  • MDB Version: 4.5.15
  • Device: Any
  • Browser: Any
  • OS: Any
  • Provided sample code: No
  • Provided link: Yes