Skip to main content

Hi,

When selecting widgets with Miro SDK, widgets get selected as expected but they don’t allow regular keyboard edit options like delete or arrow keys for nudging. The same work as expected when widgets are selected manually.

miro.board.selection.selectWidgets(s...selectableWidgets]);

Regards,

Ramkumar

cc @Scott Stephens  @Farbod Saraf 


Hi @Ramkumar@Markus Smet,

 

Sorry for the late reply I was doing some testing.

I tried both using the Chrome developer console and a demo plugin. 

What I tested:

  1. Created a Sticky note on the board using the Miro UI
  2. Making sure that I have the mouse pointer enabled in the Miro UI (v shortcut on the keyboard to enable/disable it)
  3. Opened the Miro developer console and ran: 
let sticker = await miro.board.widgets.get()
await miro.board.selection.selectWidgets(sticker);
  1. I close the developer console and type on my keyboard

Result: The sticky note is selected and you can change the text of it by typing directly on the keyboard

 

If you do the same exact test but for 2. You make sure to don’t have the mouse pointer selected but the “hand” you will see that you are not able to type directly, the keyboard will be used for the shortcuts of the toolbar.

 

I reproduced the exact same behavior using the plugin code:

miro.onReady(() => {
miro.initialize({
extensionPoints: {
toolbar: {
title: "Demo app",
toolbarSvgIcon: icon,
librarySvgIcon: icon,
async onClick() {
let sticker = await miro.board.widgets.get()
await miro.board.selection.selectWidgets(sticker);
},
},
},
});
});

 

You will experiment with the same behavior when using the Miro UI. 

This is not related to the Web SDK but this is how Miro works.

 

Hope it clarifies,

Anthony


Reply