Skip to content

Commit

Permalink
fix alt -> title and publish
Browse files Browse the repository at this point in the history
  • Loading branch information
zackify committed May 27, 2023
1 parent 5ca24e2 commit 4775425
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions src/Monthly/MonthlyBody.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export function MonthlyBody<DayData>({
key={day.day}
className={headingClassName}
aria-label="article"
alt="Day of Week"
title="Day of Week"
>
{day.label}
</div>
Expand All @@ -103,7 +103,7 @@ export function MonthlyBody<DayData>({
key={index}
className={headingClassName}
aria-label="article"
alt="Empty Day"
title="Empty Day"
/>
))}
{daysToRender.map(day => (
Expand Down Expand Up @@ -133,7 +133,7 @@ export function MonthlyDay<DayData>({ renderDay }: MonthlyDayProps<DayData>) {
return (
<div
aria-label="article"
= alt={`Events for day ${dayNumber}`}
title={`Events for day ${dayNumber}`}
className="rc-h-48 rc-p-2 rc-border-b-2 rc-border-r-2"
>
<div className="rc-flex rc-justify-between">
Expand Down
2 changes: 1 addition & 1 deletion src/Monthly/MonthlyCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const MonthlyNav = () => {
<div
className="rc-ml-4 rc-mr-4 rc-w-32 rc-text-center"
aria-label="article"
alt="Current Month"
title="Current Month"
>
{format(
currentMonth,
Expand Down
2 changes: 1 addition & 1 deletion src/Weekly/WeeklyCalendar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const DayButton = ({ day }: DayButtonProps) => {
onClick={() => changeSelectedDay(isSelected ? undefined : currentDate)}
className="rc-bg-white rc-cursor-pointer"
aria-label="article"
alt="Day of Week"
title="Day of Week"
>
<div
className={`rc-rounded-lg rc-border sm:rc-w-36 rc-text-center rc-py-4 ${
Expand Down

3 comments on commit 4775425

@danielmilano1
Copy link
Contributor

@danielmilano1 danielmilano1 commented on 4775425 May 30, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Zack,

Sorry to mess you up with the alt's. :(

So after thinking on my issue with aria-label's, I realized we were both using them incorrectly.

The problem I'm trying to solve is --> [aria-*] attributes do not match their roles --> aria-label="Empty Day"
After digging into it... it looks like the best option is to either get rid of all [aria-label="article"]
and to use title="" instead like above,
or use aria-describedby like suggested on mozilla.org. (below)

Using aria-label="article" might conflict with the role of the parent div. [grid]

https://developer.mozilla.org/en-US/docs/Web/Accessibility/ARIA/Roles/gridcell_role#describing_the_position_of_gridcells_when_the_overall_structure_is_unknown

Please let me know what you think.

Thanks,
Daniel

@zackify
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don’t really have time to focus on it, so if you want to make another attempt go for it and I can publish after

@danielmilano1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good, thanks. I'll see what I can do.

Please sign in to comment.