Compare commits
2 Commits
d70fac24ed
...
9c3a4ee91b
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c3a4ee91b | ||
|
|
bad176a6d1 |
@@ -176,6 +176,12 @@ class Images extends Component {
|
|||||||
fetchPriority="high"
|
fetchPriority="high"
|
||||||
loading="eager"
|
loading="eager"
|
||||||
alt={this.props.productName || 'Produktbild'}
|
alt={this.props.productName || 'Produktbild'}
|
||||||
|
onError={(e) => {
|
||||||
|
// Ensure alt text is always present even on error
|
||||||
|
if (!e.target.alt) {
|
||||||
|
e.target.alt = this.props.productName || 'Produktbild';
|
||||||
|
}
|
||||||
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
objectFit: 'contain',
|
objectFit: 'contain',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
@@ -240,6 +246,12 @@ class Images extends Component {
|
|||||||
component="img"
|
component="img"
|
||||||
height="80"
|
height="80"
|
||||||
alt={`${this.props.productName || 'Produktbild'} - Bild ${originalIndex + 1}`}
|
alt={`${this.props.productName || 'Produktbild'} - Bild ${originalIndex + 1}`}
|
||||||
|
onError={(e) => {
|
||||||
|
// Ensure alt text is always present even on error
|
||||||
|
if (!e.target.alt) {
|
||||||
|
e.target.alt = `${this.props.productName || 'Produktbild'} - Bild ${originalIndex + 1}`;
|
||||||
|
}
|
||||||
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
objectFit: 'contain',
|
objectFit: 'contain',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
@@ -314,6 +326,12 @@ class Images extends Component {
|
|||||||
<CardMedia
|
<CardMedia
|
||||||
component="img"
|
component="img"
|
||||||
alt={this.props.productName || 'Produktbild'}
|
alt={this.props.productName || 'Produktbild'}
|
||||||
|
onError={(e) => {
|
||||||
|
// Ensure alt text is always present even on error
|
||||||
|
if (!e.target.alt) {
|
||||||
|
e.target.alt = this.props.productName || 'Produktbild';
|
||||||
|
}
|
||||||
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
objectFit: 'contain',
|
objectFit: 'contain',
|
||||||
width: '90vw',
|
width: '90vw',
|
||||||
@@ -368,6 +386,12 @@ class Images extends Component {
|
|||||||
component="img"
|
component="img"
|
||||||
height="60"
|
height="60"
|
||||||
alt={`${this.props.productName || 'Produktbild'} - Miniaturansicht ${originalIndex + 1}`}
|
alt={`${this.props.productName || 'Produktbild'} - Miniaturansicht ${originalIndex + 1}`}
|
||||||
|
onError={(e) => {
|
||||||
|
// Ensure alt text is always present even on error
|
||||||
|
if (!e.target.alt) {
|
||||||
|
e.target.alt = `${this.props.productName || 'Produktbild'} - Miniaturansicht ${originalIndex + 1}`;
|
||||||
|
}
|
||||||
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
objectFit: 'contain',
|
objectFit: 'contain',
|
||||||
cursor: 'pointer',
|
cursor: 'pointer',
|
||||||
|
|||||||
@@ -308,6 +308,12 @@ class Product extends Component {
|
|||||||
alt={name}
|
alt={name}
|
||||||
fetchPriority={this.props.priority === 'high' ? 'high' : 'auto'}
|
fetchPriority={this.props.priority === 'high' ? 'high' : 'auto'}
|
||||||
loading={this.props.priority === 'high' ? 'eager' : 'lazy'}
|
loading={this.props.priority === 'high' ? 'eager' : 'lazy'}
|
||||||
|
onError={(e) => {
|
||||||
|
// Ensure alt text is always present even on error
|
||||||
|
if (!e.target.alt) {
|
||||||
|
e.target.alt = name || 'Produktbild';
|
||||||
|
}
|
||||||
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
objectFit: 'contain',
|
objectFit: 'contain',
|
||||||
borderTopLeftRadius: '8px',
|
borderTopLeftRadius: '8px',
|
||||||
@@ -323,6 +329,12 @@ class Product extends Component {
|
|||||||
alt={name}
|
alt={name}
|
||||||
fetchPriority={this.props.priority === 'high' ? 'high' : 'auto'}
|
fetchPriority={this.props.priority === 'high' ? 'high' : 'auto'}
|
||||||
loading={this.props.priority === 'high' ? 'eager' : 'lazy'}
|
loading={this.props.priority === 'high' ? 'eager' : 'lazy'}
|
||||||
|
onError={(e) => {
|
||||||
|
// Ensure alt text is always present even on error
|
||||||
|
if (!e.target.alt) {
|
||||||
|
e.target.alt = name || 'Produktbild';
|
||||||
|
}
|
||||||
|
}}
|
||||||
sx={{
|
sx={{
|
||||||
objectFit: 'contain',
|
objectFit: 'contain',
|
||||||
borderTopLeftRadius: '8px',
|
borderTopLeftRadius: '8px',
|
||||||
|
|||||||
@@ -33,6 +33,12 @@ const ProductImage = ({
|
|||||||
alt={product.name}
|
alt={product.name}
|
||||||
fetchPriority="high"
|
fetchPriority="high"
|
||||||
loading="eager"
|
loading="eager"
|
||||||
|
onError={(e) => {
|
||||||
|
// Ensure alt text is always present even on error
|
||||||
|
if (!e.target.alt) {
|
||||||
|
e.target.alt = product.name || 'Produktbild';
|
||||||
|
}
|
||||||
|
}}
|
||||||
sx={{ objectFit: "cover" }}
|
sx={{ objectFit: "cover" }}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
|||||||
Reference in New Issue
Block a user