Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Fitbit OS Simulator can't detetect click events on Wndows 10

I have started a new app for Fitbit device and it is very odd but I can't get click events on Fitbit Simulator (Widnows 10 Pro). I just installed last SDK  and simulator a few days ago. Installation passed ok. But how test app when clicks don't work on simulator? Do you have any idea what is wrong?

 

<image id="myImage" pointer-events="visible" href="images/snap.png" width="102" height="102" x="50%-51" y="100% - 107" />

..

import * as document from "document";

 

var img = document.getElementById("myImage");
img.addEventListener("click", (evt) => {
     console.log("voila! clicked");
});

 

I set SDK 4.2 and use Fitbit Versa 2 Simulator. But it doesn't work for others too.

Maybe I missed something?

 

I have read other posts with that issue but it doesn't help. I set my simulator window to 100% (Ctrl + 0). Seems it is not this case.

 

 

Best Answer
0 Votes
4 REPLIES 4

Do you have the simulator set to 100%?  => Ctrl+0 (zero)

If simulator is set to zoom it usually don't react at all clicks. (It reacts at some clicks)

I use:

 

img.onclick = () => { 
    console.log("voila! clicked");

}

Community Council MemberMario Dings | Rotterdam NL
Fitbit: Versa, Versa2, Sense. (Versa light) - Phone: Android. - Developer clockfaces.(Nederlands)
Best Answer
0 Votes

Yes, I use 100% simulator window. I tried with all simulators: Iconic, Versa 2, Sense etc. Nothing better.

Luckily, click events work perfect on real device.


Till I find any solution I use simulator to arrange UI but testing on real device.Well, it is not bad but could be better 🙂


Thanks for your response.

Best Answer

Hi @andorb  - there are all sorts of traps for click events, such as overlapping fields, so that it can work in some cases and not in others depending on where you tap.

 

Using a mouse it probably means the area clicked is very precise but on a watch it may be more random and so seems to work.

 

Therefore make sure you don't have other definitions after myImage in your SVG.

Author | ch, passion for improvement.

Best Answer
0 Votes

I'd recommend to add separate element(s) with eg opacity=0 pointer-events= visible at the end of the index.view. This way you can bind the event(s) to the tap-zone(s) 

Best Answer
0 Votes