sachinchoolur/lightGallery

Alt text bug

PeterBowater opened this issue · 1 comments

Description

Describe the issue that you're seeing.

Referencing: #1545

You are unable to set an alt text of just '', to get an 'empty' alt text I have to user alt: ' ' as the attribute (i.e. with a space).

Additionally, the thumbnail images do not have an alt text attribute at all -ideally this should be definable, but most likely should just be set to "".

Thank you !

Steps to reproduce

See attached code.

JS code that you use to initialize lightGallery.

	const dynamicEl = images.map((value) => ({
		src: value.data.original.url,
		thumb: value.data.thumb.url,
		alt: ' ',
	}));

useEffect(() => {
			const inlineGallery = lightGallery(lgContainer.current, {
				container: lgContainer.current,
				dynamic: true,
				hash: false,
				plugins: [lgZoom, lgThumbnail],
				closable: false,
				showMaximizeIcon: true,
				appendSubHtmlTo: '.lg-item',
				slideDelay: 400,
				dynamicEl,
				preload: 1,
				download: false,
			});

			inlineGallery.openGallery();
		}
	}, []);

Environment

  • Browser and version - all
  • OS - all
  • lightGallery version - 2.7.1

Additional context

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.