Skip to content

Commit

Permalink
[#2583] Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
jiromaykin committed Jul 4, 2024
1 parent 018744c commit b426146
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="notifications notifications__errors">
<div class="notification notification--warning">
{% icon icon="warning_amber" icon_position="before" outlined=True %}
<div class="notification__content" tabindex="-1">
<div class="notification__content" role="alert" tabindex="-1">
<p class="utrecht-paragraph utrecht-paragraph--oip utrecht-paragraph--oip-compact">{{ message.message }}</p>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,14 @@
</div>
{% endif %}

<div class="notification__content" role="region" tabindex="-1">
<div class="notification__content"
{% if type == "error" %}
role="alert"
{% elif type == "warning" %}
role="alert"
{% else %}
role="status"
{% endif %} tabindex="-1">
{% if title %}<h2 class="utrecht-heading-2">{{ title }}</h2>{% endif %}
{% if notification %}<p class="utrecht-paragraph">{{ notification }}</p>{% endif %}
{% if action %}{% button href=action text=action_text %}{% endif %}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{% load notification_tags string_tags %}

<div class="notifications">
<section class="notifications">
{% for message in messages %}
{% with as_markdown=message.extra_tags|is_substring:"as_markdown" %}
{% with local_message=message.extra_tags|is_substring:"local_message" %}
Expand All @@ -14,4 +14,4 @@
{% endwith %}
{% endwith %}
{% endfor %}
</div>
</section>
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,7 @@ export class NotificationsList {

scrollToFirstNotification() {
if (this.notificationContents.length > 0) {
// Log before the timeout starts
console.log(
'Scrolling to first notification and setting a timeout to focus.'
)

// Scroll to the first notification
// Scroll to the first notification, since there could be multiple
this.notificationContents[0].scrollIntoView({
block: 'center',
behavior: 'smooth',
Expand All @@ -25,9 +20,6 @@ export class NotificationsList {
setTimeout(() => {
// Set focus on the first notification content
this.notificationContents[0].focus()

// Log after the timeout completes
console.log('Focus set on the first notification content.')
}, 100) // Adjust the delay as necessary
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@

&:focus,
&:focus-visible {
outline: 3px solid red;
outline: none;
border: none;
}

Expand Down

0 comments on commit b426146

Please sign in to comment.