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

Bug: combo buttons don't work

 If you define two combo buttons on different screens, the hardware button won't trigger the combo button.

@JonFitbit, there's the high severity bug making combo button widget practically unusable. Or I'm missing something.

<svg id="timer_config" display="none">
<use id="btn-br" href="#combo-button-lower-right" fill="fb-peach">
<set href="combo-button-icon" attributeName="href" to="icons/btn_combo_play_p.png"/>
<set href="combo-button-icon-press" attributeName="href" to="icons/btn_combo_play_press_p.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</svg>

<svg id="timer_screen">
<use id="btn-br-2" href="#combo-button-lower-right" fill="fb-peach">
<set href="combo-button-icon" attributeName="href" to="icons/btn_combo_play_p.png"/>
<set href="combo-button-icon-press" attributeName="href" to="icons/btn_combo_play_press_p.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</svg>

I can create my own implementation of the combo button which would work properly, but it defeats the whole purpose of the SDK.

I would propose to increase the size of an application heap, make widgets implementation in JS, and open source this implementation making it the part of the SDK distribution. In this case, I bet I could just fix this bug without waiting for FitBit developers who seem to be quite busy with something.

Best Answer
0 Votes
15 REPLIES 15

We still have an internal issue tracking this bug, I've asked for an update.

 

I believe the workaround is to use the onclick event instead of onactivate.

Best Answer
0 Votes

>  I believe the workaround is to use the onclick event instead of onactivate

I tried that. The major problem is, however, that it doesn't react on the hardware button. And as far as I remember, manual event subscription for the button doesn't work as well when the combo button is present on the screen.

I would be happy to help you fix that bugs assuming that the implementation is in JS and it's open source.

Best Answer

Is there any update for a fix on this bug or is the work around still to use the onclick event?

Best Answer
0 Votes

@jomis003 wrote:

Is there any update for a fix on this bug or is the work around still to use the onclick event?


I think the workaround is to put the combo-button inside an SVG that is inside a template and then reference it in <use>.

Best Answer
0 Votes

Thank EmTe

 

More specifically I am trying to use the combo buttons on different screens (svg's). Here is my code:

 

<svg id="screen1">
<rect id="background" />

<use id="btn-tr" href="#combo-button-upper-right" fill="fb-red">
  <set href="combo-button-icon" attributeName="href" to="list.png"/>
  <set href="combo-button-icon-press" attributeName="href" to="list.png"/>
  <set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>

</svg>

<svg id="screen2" display="none">
  <use id="btn-br" href="#combo-button-lower-right" fill="fb-peach">
  <set href="combo-button-icon" attributeName="href" to="list.png"/>
  <set href="combo-button-icon-press" attributeName="href" to="list.png"/>
  <set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</svg>

 

When configured in this way, the physical action of pushing the button on screen1 (onactivate) is not working to move to screen2. The buttons work within a single svg.

 

I thought @JonFitbit said that there is still an open issue on this. I was wondering if it is still an issue.

 

 

Best Answer
0 Votes

You need to use templates.

<dfn>
<symbol id="screen1a">
<svg> <rect id="background" /> <use id="btn-tr" href="#combo-button-upper-right" fill="fb-red"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use> </svg>
</symbol>
<symbol id="screen2a"> <svg> <use id="btn-br" href="#combo-button-lower-right" fill="fb-peach"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use> </svg>
</symbol>
</dfn>

<use id="screen1" href="#screen1a" />
<use id="screen2" href="#screen2a" display="none" />

Something like that.

Best Answer

I am getting a whole host of errors when using that code. I was able to minimize them by moving the defs outside of the symbols but it is still not functional. 

 

<svg>
<rect id="background" />
<defs>
<symbol id="screen1a">
<use id="btn-tr" href="#combo-button-upper-right" fill="fb-red">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</symbol>
</defs>
</svg>


<svg>
<defs>
<symbol id="screen2a">
<use id="btn-br" href="#combo-button-lower-right" fill="fb-peach">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</symbol>
</defs>
</svg>


<use id="screen1" href="#screen1a" />
<use id="screen2" href="#screen2a" display="none"/>

 

With this I am getting

Error 22 Could not find symbol '#screen2a' in screen 2 

and

Error 22 Undefined attribute 'href' in screen2 (I assume because of the first error)

 

Best Answer
0 Votes

Two things.

First - "defs" must be in the same "svg" to be visible. That's correct code:

<svg>
<rect id="background" />
<defs>
<symbol id="screen1a">
<use id="btn-tr" href="#combo-button-upper-right" fill="fb-red">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
  <use id="btn-br" href="#combo-button-lower-right" fill="fb-peach">
  <set href="combo-button-icon" attributeName="href" to="list.png"/>
  <set href="combo-button-icon-press" attributeName="href" to="list.png"/>
  <set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</symbol>
<symbol id="screen2a">
<use id="btn-br-v" href="#combo-button-lower-right" fill="fb-peach">
  <set href="combo-button-icon" attributeName="href" to="list.png"/>
  <set href="combo-button-icon-press" attributeName="href" to="list.png"/>
  <set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</symbol>
</defs>

<use id="screen1" href="#screen1a" display="none"/>
<use id="screen2" href="#screen2a" />
  
</svg>


And the second one. This is not a workaround for anything. It's still broken in the same way as I originally described. Click at the hardware button and see yourself.

Best Answer

The reason for this bug is that combo button implementation assumes that there's only the single button in each corner per application, no matter are other buttons hidden or not.

This bug makes combo button useless for anything but very simple or demo apps.

No, it's not fixed yet and I wouldn't count on it to be fixed in near future. The workaround is to implement your own corner buttons.

I would add that having 64K RAM restriction and closed implementation of these widgets is one of the major and obvious design flaws of the SDK. If it would be 128K or RAM and these widgets would be available to import as JS/SVG library I would have fixed this thing already. Not a big deal at all.

It's sad that after one year since the SDK announcement it's still in "very promising" state. Could be a great product.

Best Answer
0 Votes

You forgot to add back the SVG inside the symbols to make it work. I've updated the below.

 


@gaperton wrote:


First - "defs" must be in the same "svg" to be visible. That's correct code:

<svg>
<rect id="background" />
<defs>
<svg> <symbol id="screen1a"> <use id="btn-tr" href="#combo-button-upper-right" fill="fb-red"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use> <use id="btn-br" href="#combo-button-lower-right" fill="fb-peach"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use>
</svg> </symbol> <symbol id="screen2a">
<svg> <use id="btn-br-v" href="#combo-button-lower-right" fill="fb-peach"> <set href="combo-button-icon" attributeName="href" to="list.png"/> <set href="combo-button-icon-press" attributeName="href" to="list.png"/> <set href="combo-button-stroke" attributeName="display" to="inline"/> </use>
</svg> </symbol> </defs> <use id="screen1" href="#screen1a" display="none"/> <use id="screen2" href="#screen2a" /> </svg>

 

Best Answer

That's right, I forgot about that. Did I make it right this time? Same thing. Unfortunately, it doesn't help.

 

<svg>
<rect id="background" />
<defs>
<symbol id="screen1a">
<svg>
<use id="btn-tr" href="#combo-button-upper-right" fill="fb-red">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
<use id="btn-br" href="#combo-button-lower-right" fill="fb-peach">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</svg>
</symbol>
<symbol id="screen2a">
<svg>
<use id="btn-br-v" href="#combo-button-lower-right" fill="fb-peach">
<set href="combo-button-icon" attributeName="href" to="list.png"/>
<set href="combo-button-icon-press" attributeName="href" to="list.png"/>
<set href="combo-button-stroke" attributeName="display" to="inline"/>
</use>
</svg>
</symbol>
</defs>

<use id="screen1" href="#screen1a" display="none"/>
<use id="screen2" href="#screen2a" />

</svg>
Best Answer

That indeed did work.... Thank you both.

 

Best Answer


@gaperton wrote:

That's right, I forgot about that. Did I make it right this time?

@jomis003 wrote:

That indeed did work.... Thank you both.

 


You're welcome. Please vote for my answer if it helped solve your problem.

Best Answer

Hardware button still doesn’t work, so unfortunately it’s not a workaround.

Best Answer
0 Votes

@JonFitbit  yup that works for me. However, the hardware button still doesn't work. 


@JonFitbit wrote:

We still have an internal issue tracking this bug, I've asked for an update.

 

I believe the workaround is to use the onclick event instead of onactivate.


 

Best Answer
0 Votes