Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

input_pill: Fix bug where focus indicator wasn't showing.

Evy Kassirer25664e87bd90
diff --git a/web/styles/input_pill.css b/web/styles/input_pill.css
index 7b2f4f05778..c9ce0427b0c 100644
--- a/web/styles/input_pill.css
+++ b/web/styles/input_pill.css
@@ -32,9 +32,21 @@
background-color: var(--color-background-input-pill);
cursor: pointer;
+ /* Not focus-visible, because we want to support mouse+backpace to
+ delete pills */
&:focus {
- border-color: var(--color-focus-outline-input-pill);
+ /* Box shadow instead of border, because user pills have avatars
+ that extend all the way to the edge of the pill. */
+ box-shadow: 0 0 0 1px var(--color-focus-outline-input-pill) inset;
outline: none;
+
+ /* For user pills with avatars, the avatar covers up the box
+ shadow, so we also have to make a border around the avatar. */
+ .pill-image-border {
+ border-right: none;
+ border-radius: 4px 0 0 4px;
+ border-color: var(--color-focus-outline-input-pill);
+ }
}
.pill-image {
diff --git a/web/styles/search.css b/web/styles/search.css
index 5a325e3ee9f..6f7b7752756 100644
--- a/web/styles/search.css
+++ b/web/styles/search.css
@@ -268,6 +268,15 @@
height: unset;
border: 1px solid transparent;
+ /* Not focus-visible, because we want to support mouse+backpace
+ to delete pills */
+ &:focus {
+ /* Unlike regular `.pill` this multi-user pill has a border,
+ so we use border instead of box-shadow on focus. */
+ box-shadow: none;
+ border-color: var(--color-focus-outline-input-pill);
+ }
+
> .pill-label {
min-width: fit-content;
white-space: nowrap;