Skip to content

Commit

Permalink
Fix gallery margin while typing. (#10221)
Browse files Browse the repository at this point in the history
#10027 introduced a small bug where the last item in a gallery jumps around when a user is in the process of adding a caption.

This is due to a `:nth-last-child(2)` style rule that is applied to a gallery when it has an `is-selected` class, but not an `is-typing` class.

This PR modifies that rule to include the `is-typing` class and remove the jump.
  • Loading branch information
kjellr authored Sep 28, 2018
1 parent 007f15c commit 3eacbf9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion packages/block-library/src/gallery/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,9 @@
.blocks-gallery-image:last-child,
.blocks-gallery-item:last-child,
.is-selected & .blocks-gallery-image:nth-last-child(2),
.is-selected & .blocks-gallery-item:nth-last-child(2) {
.is-selected & .blocks-gallery-item:nth-last-child(2),
.is-typing & .blocks-gallery-image:nth-last-child(2),
.is-typing & .blocks-gallery-item:nth-last-child(2) {
margin-right: 0;
}

Expand Down

0 comments on commit 3eacbf9

Please sign in to comment.