betamos/Better-Autocomplete

Feature reqest : Add a callback in redraw.

Closed this issue · 2 comments

There would be good with a callback executed after the result element is .show() and .hide().

I.E

 // Finally show/hide based on focus and emptiness
    if (($input.is(':focus') || focus) && !$results.is(':empty')) {
      $results.filter(':hidden').show() // Show if hidden
        .scrollTop($results.data('scroll-top')); // Reset the lost scrolling
        AFTERSHOW CALLBACK HERE
    }
    else if ($results.is(':visible')) {
      // Store the scrolling position for later
      $results.data('scroll-top', $results.scrollTop())
        .hide(); // Hiding it resets it's scrollTop
        AFTERHIDE CALLBACK HERE
    }

Looks neat. I'll look into it.

This is now implemented as afterHide and afterShow callbacks. See 8393c81 for details.