Skip to main content

[BUG monday SDK] monday.execute for 'openItemCard' does not resolve promise for kind 'updates' when closing item card

  • May 17, 2023
  • 8 replies
  • 402 views

Forum|alt.badge.img

Hi there,

I created a new issue for the monday-sdk-js package: [Bug] monday.execute for 'openItemCard' does not resolve promise for kind 'updates' · Issue #92 · mondaycom/monday-sdk-js · GitHub
I wanted to report it here as well in case I am missing someone or to check if someone else also experienced this issue.
This is a blocking bug for us in creating a custom view in monday.com.

Thank you for checking this and helping us out!

8 replies

Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • May 18, 2023

Hello there @frednijs,

Thank you for that!

I will share this with the person in charge of it so that it can be checked 😁

Cheeers,
Matias


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • May 24, 2023

Hello again @frednijs,

A fix for this will be deployed soon. You can check it next Monday and it should be deployed already.

Cheers,
Matias


Forum|alt.badge.img
  • Author
  • New Participant
  • May 24, 2023

Great, thank you!


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • May 29, 2023

Happy to help @frednijs !


70shakeel
  • Participating Frequently
  • June 16, 2023

Was this resolved?
I am facing the same issue.
monday.execute(“openItemCard”, {
itemId: item.id,
kind:“updates”
});


Forum|alt.badge.img
  • Author
  • New Participant
  • June 16, 2023

We tested this and this issue was resolved. However, we are also facing the issue again.

Since opening the item card is resizing the window where the app is running, we used this code as a workaround. It is not completely failsafe and it is of course a workaround but it is doing the trick for us. Maybe it can help you as well.

/**
 * Workaround for issue: https://github.com/mondaycom/monday-sdk-js/issues/92
 */
const resizePromise = new Promise<void>((resolve) => {
  const initialWidth = window.innerWidth;
  const resizeHandler = () => {
    if (window.innerWidth >= initialWidth) {
      resolve();
      window.removeEventListener('resize', resizeHandler);
    }
  };
  setTimeout(() => {
    window.addEventListener('resize', resizeHandler);
  }, 500);
});

const mondayPromise = monday.execute('openItemCard', { itemId: item.id, kind: 'updates' });
await Promise.any([resizePromise, mondayPromise]);


70shakeel
  • Participating Frequently
  • June 16, 2023

can you share the output? If I do not give kind attribute it is opening up an item view card and when I give kind: “updates” as an attribute, it shows nothing.


Matias.Monday
Forum|alt.badge.img
  • monday.com Team Member
  • June 18, 2023

Hello there,

If you are still facing issues with this, please send over an email to appsupport@monday.com with all the data about your situation and we will take a closer look from there!

Cheers,
Matias