Pagination buttons cause blur when blurable is enabled

Pagination buttons cause blur when blurable is enabled

sliekenssliekens Posts: 97Questions: 17Answers: 2
edited February 2017 in Select

When Select is enabled and select.blurable is active, the selection is blurred when changing the current page by clicking the pager buttons.

http://live.datatables.net/xayarene/1/edit?js,output

This happens because the page buttons are removed from the DOM before Select has a chance to determine if the click was inside the table container.

I fixed it by changing Select to ignore clicks on elements that are not currently in the DOM.

    if ( ctx._select.blurable ) {
      // If the click was on a node that has since been removed from the DOM, don't blur
      if (e.target.getRootNode() !== document) {
        return;
      }
     ...

Replies

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin

    Thanks! I'll get the fix in for the next release.

    Allan

  • allanallan Posts: 63,368Questions: 1Answers: 10,449 Site admin

    Just to confirm, this will be in the next release of Select -
    commit.

    Regards,
    Allan

This discussion has been closed.