Skip to content

Commit

Permalink
fix: rename erroneous title attribute to alt
Browse files Browse the repository at this point in the history
  • Loading branch information
igordanchenko committed Jun 1, 2022
1 parent 6cc2a91 commit d9be101
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/core/components/ImageSlide.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export const ImageSlide = ({ slide: image, render }: ImageSlideProps) => {
onError={onError}
className={clsx(cssClass("slide_image"), state !== "complete" && cssClass("slide_image_loading"))}
draggable={false}
alt={image.title}
alt={image.alt}
{...(image.srcSet
? {
// this approach does not account for carousel padding,
Expand Down
17 changes: 9 additions & 8 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ import PropTypes from "prop-types";

/** Image slide properties */
export interface SlideImage {
/** Image URL */
/** image URL */
src?: string;
title?: string;
/** Image aspect ratio */
/** image 'alt' attribute */
alt?: string;
/** image aspect ratio */
aspectRatio?: number;
/** Alternative images to be passed to 'srcSet' */
/** alternative images to be passed to 'srcSet' */
srcSet?: {
/** Image URL */
/** image URL */
src: string;
/** Image width in pixels */
/** image width in pixels */
width: number;
}[];
}

/** Supported slide types */
export interface SlideTypes {
/** Image slide type */
/** image slide type */
SlideImage: SlideImage;
}

Expand Down Expand Up @@ -90,7 +91,7 @@ export interface Callbacks {

/** Lightbox properties */
export interface LightboxProps {
/** Open flag. If true, the lightbox is open. */
/** if `true`, the lightbox is open */
open: boolean;
/** a callback to close the lightbox */
close: () => void;
Expand Down

0 comments on commit d9be101

Please sign in to comment.