Ticket #6461 (closed enhancement: fixed)

Opened 5 months ago

Last modified 2 months ago

ComboBox: Highlight the search string in items in the drop down

Reported by: wolfram Owned by: wolfram
Priority: normal Milestone: 1.2
Component: Dijit Version: 1.1.0
Severity: normal Keywords:
Cc:

Description


Change History

Changed 5 months ago by wolfram

  • status changed from new to closed
  • resolution set to fixed

Fixed by [13288]

Changed 5 months ago by bill

  • status changed from closed to reopened
  • summary changed from Highlight the search string in the drop down of a ComboBox to ComboBox: Highlight the search string in items in the drop down
  • resolution deleted
  • milestone set to 1.2

Unfortunately this isn't going to work if search string and/or returned results have special characters in them.

So for example, if the user types in "lt>" and it matches an item called "lt><&lt", make sure the highlighting works correctly in that case.

Changed 4 months ago by doughays

  • milestone changed from 1.2 to 1.3

Changed 4 months ago by bill

  • owner set to wolfram
  • status changed from reopened to new

Wolfram is working on this so assigning to him. I think the code checked in in [13288] just needs to be changed to first convert both the search string and the item from plain text to HTML; 0.4 had a function for this but unfortunately was removed in 0.9. However, there is code in InlineEditBox and/or TextArea to do the same thing:

value = value.replace(/&/gm, "&amp;").replace(/</gm, "&lt;").replace(/>/gm, "&gt;").replace(/"/gm, "&quot;")
.replace(/\n/g, "<br>");

Changed 4 months ago by wolfram

  • status changed from new to closed
  • resolution set to fixed

(In [13340]) + encode HTML entities properly, so they at least dont screw up the markup fixes#6461

Changed 4 months ago by wolfram

(In [13341]) + mainly serves as example data refs#6461

Changed 4 months ago by wolfram

(In [13343]) + optimized refs#6461 as of Bill's suggestion, thx

Changed 4 months ago by wolfram

(In [13614]) + refs#6461, make highlightMatch take one of: first, all, none

Changed 4 months ago by wolfram

(In [13615]) + refs#6461, make highlightMatch find matches only at the beginning of a string and at word boundaries, this is more natural

Changed 3 months ago by peller

  • milestone changed from 1.3 to 1.2

Changed 2 months ago by guest

Comments in ComboBox?.js indicate that doHighlight() should be overridden for custom highlighting, but _lastInput is not passed to this method. User must access the private variable _lastInput to override. Ideally, I think, pass in "this._escapeHTML(this._lastInput)" as second parameter to doHighlight(), giving user everything he needs to cleanly override. Many thanks!

Changed 2 months ago by wolfram

Great idea, thx

Changed 2 months ago by wolfram

done in [13979]

Note: See TracTickets for help on using tickets.