Skip to content

Commit

Permalink
Scheduler a11y: Images must have alternate text (DevExpress#28231)
Browse files Browse the repository at this point in the history
  • Loading branch information
tongsonbarbs authored Oct 24, 2024
1 parent 234fe6b commit affffdf
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
*ngIf="getMovieById | apply : model.appointmentData.movieId as movie"
>
<div class="movie">
<img [src]="movie.image" />
<img [src]="movie.image" alt="{{ movie.text }} poster" />
<div class="movie-text">{{ movie.text }}</div>
</div>
</ng-container>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ const AppointmentTemplate = (props: AppointmentTemplateProps) => {

return (
<div className="movie">
<img src={movieInfo.image} />
<img src={movieInfo.image} alt={movieInfo.text + ' poster'} />
<div className="movie-text">{movieInfo.text}</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ const AppointmentTemplate = (props) => {
const movieInfo = getMovieById(appointmentData.movieId) || {};
return (
<div className="movie">
<img src={movieInfo.image} />
<img
src={movieInfo.image}
alt={`${movieInfo.text} poster`}
/>
<div className="movie-text">{movieInfo.text}</div>
</div>
);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<template>
<div class="movie">
<img :src="movieInfo.image">
<img :src="movieInfo.image" :alt="`${movieInfo.text} poster`">
<div class="movie-text">{{ movieInfo.text }}</div>
</div>
</template>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $(() => {
const movieInfo = getMovieById(model.appointmentData.movieId) || {};

return $(`${"<div class='movie'>"
+ "<img src='"}${movieInfo.image}' />`
+ "<img src='"}${movieInfo.image}' alt='${movieInfo.text} poster' />`
+ `<div class='movie-text'>${movieInfo.text}</div>`
+ '</div>');
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<h2>{{ employee.text }}</h2>
</div>
<div class="avatar">
<img [src]="employee.data.avatar" />
<img [src]="employee.data.avatar" alt="{{ employee.text }} photo" />
</div>
<div class="info" [style.color]="employee.color">
Age: {{ employee.data.age }}
Expand Down
5 changes: 4 additions & 1 deletion apps/demos/Demos/Scheduler/Overview/React/ResourceCell.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,10 @@ const ResourceCell = (props: ResourceCellProps) => {
<h2>{text}</h2>
</div>
<div className="avatar">
<img src={avatar} />
<img
src={avatar}
alt={`${text} photo`}
/>
</div>
<div className="info" style={{ color }}>
Age: {age}
Expand Down
5 changes: 4 additions & 1 deletion apps/demos/Demos/Scheduler/Overview/ReactJs/ResourceCell.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ const ResourceCell = (props) => {
<h2>{text}</h2>
</div>
<div className="avatar">
<img src={avatar} />
<img
src={avatar}
alt={`${text} photo`}
/>
</div>
<div
className="info"
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/Scheduler/Overview/Vue/ResourceCell.vue
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<h2>{{ employee.text }}</h2>
</div>
<div class="avatar">
<img :src="employee.data.avatar">
<img :src="employee.data.avatar" :alt="`${employee.text} photo`">
</div>
<div
:style="'color:' + employee.color"
Expand Down
2 changes: 1 addition & 1 deletion apps/demos/Demos/Scheduler/Overview/jQuery/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ $(() => {

const avatar = $('<div>')
.addClass('avatar')
.html(`<img src=${cellData.data.avatar}>`)
.html(`<img src=${cellData.data.avatar} alt="${cellData.text} photo">`)
.attr('title', cellData.text);

const info = $('<div>')
Expand Down

0 comments on commit affffdf

Please sign in to comment.