harvesthq / platform

A whole new way to add time tracking to your web application.
https://www.getharvest.com/platform
59 stars 11 forks source link

Widget keeps grabbing focus #32

Closed tanc closed 8 years ago

tanc commented 8 years ago

I've implemented the widget on a Drupal site we use as a ticket tracking system for customer support. I've noticed that when the timer is running the 'Stop timer' button gets focused when the timer increments. This is really irritating if you're reading something elsewhere on the page, or worse when you're writing something in a field and suddenly the field loses focus and you jump down to the widget.

I've only tested this on Safari 9.0.3 so far, I can take a look at Chrome and see if its happening there too. Is this something you're aware of?

tanc commented 8 years ago

Confirmed this also happens with Chrome, the page jumps to the widget when the timer increments.

Note that I've implemented the recommended javascript to resize the widget automatically.

braddunbar commented 8 years ago

Thanks for pointing this out @tanc! I'll take a look at it. :)

braddunbar commented 8 years ago

Ok, I looked into this and it seems that setting the closable parameter to false will prevent the widget from stealing focus. Have you tried that already?

tanc commented 8 years ago

Fantastic! Changing closable to false fixed it. Thanks!

braddunbar commented 8 years ago

Glad I could help! :)