Fix for Uncaught TypeError: Cannot read property target of undefined seen on Buttons plugin

Remix of #1559 - this is the clean one :smile: