Buttons icon indicating copy to clipboard operation
Buttons copied to clipboard

Bug with collections without background: re-clicking the trigger button immediatly closes the collection again

Open GillesVermeulen opened this issue 7 years ago • 3 comments

When using a button collection without a full screen CSS background, you can just click the collection-trigger button again, and this causes unwanted behavior: The collection will fade in and immediately fade out again.

Here is an example in codepen

The reason is that the click listener on the body gets triggered as well as the click listener on the collection button, and the click listener on the body will close the collection.

Possible solution: Check in the click listener of the collection button if the collection is not already open (and then close it and remove the body listener)

GillesVermeulen avatar Nov 09 '18 14:11 GillesVermeulen

Good point - thanks for letting me know about that.

DataTables avatar Nov 09 '18 17:11 DataTables

In a related issue: when one collection is open, and you click on another collection button, the background of the second collection also fades in and immediately fades out again.

GillesVermeulen avatar Nov 12 '18 10:11 GillesVermeulen

Related to this issue?

https://datatables.net/forums/discussion/56188/bug-button-collection-doesnt-work#latest

stephanvierkant avatar May 07 '19 11:05 stephanvierkant

Doesn't appear to be an issue with the latest. I guess I fixed this at some point and forgot to close it, sorry.

AllanJard avatar Oct 18 '23 16:10 AllanJard