registerOnSelect method

void registerOnSelect(
  1. HintsResultsSelectCallback onSelect
)

Fired when a completion is selected. Passed the completion value and the DOM node that represents it in the menu.

The completion HintResult is not guaranteed to be the same object instance as the one provided by the HintResults.

Implementation

void registerOnSelect(HintsResultsSelectCallback onSelect) {
  Hints._cm!.callMethod('on', [
    toProxy(),
    'select',
    (completion, element) {
      if (completion is String) {
        onSelect(HintResult(completion), element);
      } else {
        onSelect(HintResult.fromProxy(completion), element);
      }
    }
  ]);
}