-
Notifications
You must be signed in to change notification settings - Fork 5
Description
The following, when clicking on the element I pass open to (for its onClick handler), the badge is still shown until I refresh the page:
const AnnounceKitBadge = ({ children }) => {
const announceKitRef = useRef<AnnounceKit>();
const open = async () => await announceKitRef?.current?.open();
const AnnounceKitElement = (
<AnnounceKit
widget={'myurl'}
ref={announceKitRef}
/>
);
return children({ open, AnnounceKitElement }) ;
};It will only disappear as expected if I were to click directly on the small circle badge instead of clicking on the element I pass the open function to as an onClick handler. This ref usage is in the example codesandbox so I'd expect it to work.
When I use catchClick and pass a selector instead of the onClick event handler, then clicking on the element I pass the selector to will make the badge disappear upon open as expected..
A related issue is passing children to AnnounceKit isn't well supported since there is no way to override the styles, the display: inline is hardcoded. Passing widgetStyle doesn't help either.
I'm using version 2.1.7.