-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Possibility to control closing. #1463
Comments
You can do it now by adding custom ui element, that will be closing gallery const uiElements = [
{
name: 'custom-close-button',
ariaLabel: 'Close button',
order: 9,
isButton: true,
html: {
isCustomSVG: true,
inner:
'<path d="<ICON_PATH>" id="pswp__icn-cstm-btn"/>',
outlineID: 'pswp__icn-cstm-btn',
},
appendTo: 'bar',
onClick: (e, el, pswpInstance) => {
pswpInstance.close();
},
},
]
const MyGallery = () => (
<Gallery uiElements={uiElements}>
{/*...*/}
</Gallery>
) |
Thank you for your response, but I need something slightly different. It’s necessary not to customize the button but to pass it into the item context, where unfortunately there is no access to |
I think we can add some |
I think yes. that would be great! |
There is no way to control closing the gallery except through the default button
I would like to be able to add a custom button to an open gallery, when clicked you can close the gallery. (This is required if there is logic inside the content that requires interaction with a click)
The text was updated successfully, but these errors were encountered: