claviska / jquery-minicolors

jQuery MiniColors Plugin
MIT License
960 stars 313 forks source link

Performance bugs #276

Open armanogan opened 5 years ago

armanogan commented 5 years ago

Hey guys,

I wondered,why you are attaching a lot of events mousedown,when you can use only 1and your mousemove and mouseup events are working always even if there is no element attached. You need to attache mousemove and mouse ONLY after mousedown event and remove the events on mouse up.The plugin works good but the code dirty is dirty.

claviska commented 5 years ago

You're right about the mousemove handler firing too frequently — it should only fire when the color picker is open. However, your observation isn't presented very tactfully.

Since you obviously took more than a passing glance at the code, why didn't you bother to submit a PR?

armanogan commented 5 years ago

I have already re-coded as it should be, if you want you can take a look.

jquery.minicolors.zip

kolosovsky commented 5 years ago

I have the same issue. Mousemove event triggers angular change detection and therefore causes performance issues.