add aria-label to notification content

+ fix notification outline
This commit is contained in:
daria 2025-04-25 14:46:56 +03:00
parent 29f6706a50
commit 5cfe9dc363
No known key found for this signature in database
GPG Key ID: 4B50D7376928C442
2 changed files with 6 additions and 1 deletions

View File

@ -100,7 +100,7 @@ define([
avatar = h('span.cp-avatar-image', h('img', { src:'/customize/CryptPad_logo.svg' }));
}
var order = -Math.floor((Util.find(data, ['content', 'msg', 'ctime']) || 0) / 1000);
const tabIndexValue = data.content.isClickable ? '0': 'undefined';
const tabIndexValue = 0; //data.content.isClickable ? '0': 'undefined';
notif = h('li.cp-notification', {
role: 'menuitem',
tabindex: '0',
@ -128,6 +128,7 @@ define([
$(notif).find('.cp-notification-content p').html(data.content.getFormatText());
}, 60000);
}
$(notif).find('.cp-notification-content').attr('aria-label', data.content.getFormatText().replace(/<[^>]*>/g, '')); // removes html tags from the text
}
$(notif).mouseenter((e) => {

View File

@ -125,6 +125,10 @@
justify-content: flex-start;
align-items: center;
margin: 0.1rem;
&:focus-visible {
outline: @variables_focus_style;
border-radius: @variables_radius;
}
p {
display: inline-block;
margin: 1rem 1rem;