Answered

How to correctly use bringForward() and sendBackward() Miro board functions

  • 16 November 2020
  • 2 replies
  • 868 views

Userlevel 2
Badge +3

Hi, I’m trying to use bringForward() and sendBackward() Miro board functions which I found here: https://github.com/miroapp/app-examples/blob/master/miro.d.ts (line 351 - 357) I assumed this only needs the widget id’s in an array but when I tried with some test data it doesn’t actually change the widget “priority” AKA doesn’t send them forward or backwards. Tried something like this: `sendbackward(arrayOfWidgets)` where arrayOFWidgets were a few selected widgets from current board

Is there a specific use case that has to be done like with miro.board.commands , where they have to be in a miro on ready block? Or am I missing something else? 

 

Thanks for any suggestions

icon

Best answer by Daniela Gavidia 16 November 2020, 18:02

View original

2 replies

Userlevel 4
Badge

Hello Sami,

 

I just tried the bringForward() method and it works as expected. I piled up several card widgets on top of each other and then called bringForward with the ids of two widgets that were obscured by others. As expected, they were brought to the front with a call like:
 

miro.board.widgets.bringForward(["3074457351646073464", "3074457351646197085"])


Calling sendBackward pushed them to the bottom of the pile of widgets.

I tested with card widgets. Are you experiencing this problem with a specific type of widget? If you could describe how to reproduce the issue, we can look into it.

And yes, you should put any calls to the SDK inside the onReady() callback:
https://developers.miro.com/docs/the-windowmiro-object#section-on-ready

Kind regards.

 

Daniela

Userlevel 2
Badge +3

Hello Sami,

 

I just tried the bringForward() method and it works as expected. I piled up several card widgets on top of each other and then called bringForward with the ids of two widgets that were obscured by others. As expected, they were brought to the front with a call like:
 

miro.board.widgets.bringForward(["3074457351646073464", "3074457351646197085"])


Calling sendBackward pushed them to the bottom of the pile of widgets.

I tested with card widgets. Are you experiencing this problem with a specific type of widget? If you could describe how to reproduce the issue, we can look into it.

And yes, you should put any calls to the SDK inside the onReady() callback:
https://developers.miro.com/docs/the-windowmiro-object#section-on-ready

Kind regards.

 

Daniela

Hi, yes the onReady() callback seems to have been the issue, thanks a lot for your help

Reply