Skip to content

Commit

Permalink
Notifications: Fix the undo dismiss button (#97850)
Browse files Browse the repository at this point in the history
* Position the dismiss button correctly, and only close the undo notification.

* Remove unnecessary styling.

* Stop event propagation instead of using a new function.
  • Loading branch information
allilevine authored Dec 31, 2024
1 parent 7492874 commit 651c397
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
6 changes: 4 additions & 2 deletions apps/notifications/src/panel/boot/stylesheets/main.scss
Original file line number Diff line number Diff line change
Expand Up @@ -579,6 +579,8 @@ $with-sidebar-min-page-width: 1114px;
p {
padding-top: 1em;
padding-bottom: 1em;
display: flex;
align-items: center;
}

.wpnc__undo-link {
Expand All @@ -594,8 +596,8 @@ $with-sidebar-min-page-width: 1114px;

.wpnc__close-link {
color: var(--color-text-inverted);
position: absolute;
right: 10px;
margin-left: auto;
padding: 0 10px;
cursor: pointer;
user-select: none;
}
Expand Down
3 changes: 2 additions & 1 deletion apps/notifications/src/panel/templates/undo-list-item.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,9 @@ export class UndoListItem extends Component {
};

actImmediately = ( event ) => {
if ( event && event.preventDefault ) {
if ( event ) {
event.preventDefault();
event.stopPropagation();
}
clearTimeout( this.state.undoTimer );
this.instance && this.setState( { isVisible: false } );
Expand Down

0 comments on commit 651c397

Please sign in to comment.