This is a migrated thread and some comments may be shown as answers.

Mark Matches - Can't search for parentheses

2 Answers 49 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
FTDEV129
Top achievements
Rank 1
FTDEV129 asked on 18 Mar 2016, 10:55 PM

I am unable to find matching items that contain parentheses. I can successfully search for other special characters like '#', '%', '|', '*', etc. but not '('. In fact, it seems that typing '(' will clear the mask.

How do I go about searching for an item that contains parentheses?

 

 

OS: Windows 7
exact browser version: Google Chrome 49.0.2623.87
exact version of the Telerik product: 2013.3.1015.45
preferred programming language: C#

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Plamen
Telerik team
answered on 23 Mar 2016, 11:24 AM
Hi,

Thank you for reporting the issue and for your concern with the controls.

The issue seems to be a bug in the control that is caused by the fact that "(" and down arrow are both generating the keycode 40 and we are preventing the markMatch when the down key is pressed. 

I have logged the issue for fixing and you can follow its status and vote for it here.

As a temporary workaround you can use the code below:
<script>
             var $T = Telerik.Web.UI;
             var $LM = Telerik.Web.UI.RadListBox.Modules;
             $LM.MarkMatch.prototype.onKeyPress= function(e) {
                 var listBox = this._rlb;
                 var selectionModeReset = false;
 
                 var code = e.charCode || e.keyCode;
                  
                 if (code < 32 && code != Sys.UI.Key.backspace && code != Sys.UI.Key.esc)
                     return true;
 
                 if(code == Sys.UI.Key.backspace)
                     e.preventDefault();
 
                 if ((code == Sys.UI.Key.esc || code == Sys.UI.Key.down || code == Sys.UI.Key.up) && !e.shiftKey) {
                     this._resetItems(this._items, true);
                     return false;
                 }
                
                 if (listBox.get_selectionMode() == $T.ListBoxSelectionMode.Multiple) {
                     listBox.set_selectionMode($T.ListBoxSelectionMode.Single);
                     selectionModeReset = true;
                 }
                 
                 if (listBox._enableMarkMatches)
                     this._handleMarkMatches(code);
                 else
                     this._handleMarkFirstMatch(code);
 
                 // If the selection mode was Multiple before the event handling - set it back
                 if (selectionModeReset)
                     listBox.set_selectionMode($T.ListBoxSelectionMode.Multiple);
 
                 return true;
             }
      </script>

Hope this information will explain  the issue and be helpful.

Regards,
Plamen
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
FTDEV129
Top achievements
Rank 1
answered on 23 Mar 2016, 10:27 PM
This information explained the issue and the workaround worked. Thanks Plamen!
Tags
ListBox
Asked by
FTDEV129
Top achievements
Rank 1
Answers by
Plamen
Telerik team
FTDEV129
Top achievements
Rank 1
Share this question
or