Accessibility feature

Can we change the button name from button to whatsapp for accessibility purposes?

1 Like

Hey there @Melissa_Lyons :wave:

Sure! Our devs came up with a custom script for your case:

const LABEL = "WhatsApp";

const waitForElement = (selector, root = document) => new Promise(res => {
  let i = 0;

  const check = () => {
    const component = root.querySelector(selector);

    if (component) {
      res(component);
    } else if (i !== 50) {
      setTimeout(check, 100);
      i++;
    }
  };

  check();
});

waitForElement("[class*='Bubble__BubbleComponent-sc']").then(button => {
  button.ariaLabel = LABEL;
});

Just add it to the Custom JS field on the Appearance tab of your widget’s settings and let me know if it helped :wink: