Skip to content

Commit

Permalink
fix(user): prevent profile picture drag (#3133)
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmcg authored May 16, 2022
1 parent b4932fe commit 2f86b32
Show file tree
Hide file tree
Showing 21 changed files with 32 additions and 29 deletions.
7 changes: 7 additions & 0 deletions assets/styles/framework/ui.less
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,10 @@
}

@mini-light-border: 1px solid rgba(199, 206, 246, 0.25);

.no-select {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
4 changes: 2 additions & 2 deletions components/interactables/AsideMenu/AsideMenu.less
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
.menu-list {
a {
-webkit-user-drag: none;
user-select: none;
&:extend(.no-select);
}
margin-bottom: @normal-spacing;
}
Expand All @@ -16,5 +16,5 @@
padding: @xlarge-spacing;
position: relative;
-webkit-user-drag: none;
user-select: none;
&:extend(.no-select);
}
4 changes: 2 additions & 2 deletions components/interactables/Select/Select.less
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
padding-left: @normal-spacing;
padding-right: @normal-spacing * 2;
cursor: pointer;
user-select: none;
&:extend(.no-select);
max-width: @full;
white-space: nowrap;
text-overflow: ellipsis;
Expand Down Expand Up @@ -59,7 +59,7 @@
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden;
user-select: none;
&:extend(.no-select);
&[disabled] {
opacity: 0.5;
}
Expand Down
2 changes: 1 addition & 1 deletion components/ui/CaretDivider/CaretDivider.less
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
transform: scaleX(1.155) skewY(-30deg) rotate(-30deg) translateY(-42.3%)
skewX(-30deg) scaleY(0.866) translateX(24%);
}
user-select: none;
&:extend(.no-select);
background: @red;
border-radius: @corner-rounding-smaller 0 0 @corner-rounding-smaller;
display: inline-block;
Expand Down
4 changes: 2 additions & 2 deletions components/ui/Chat/Image/Image.less
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
&-placeholder {
text-align: center;
max-width: 200px;
user-select: none;
&:extend(.no-select);
pointer-events: none;
&-img {
padding: @normal-spacing;
Expand All @@ -29,7 +29,7 @@
.is-normal-image {
&:extend(.round-corners);
max-width: 300px;
user-select: none;
&:extend(.no-select);
}

.file-info {
Expand Down
1 change: 1 addition & 0 deletions components/ui/Circle/Circle.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
alt="Circle Image"
:class="`${square ? 'is-square' : 'is-rounded'} image`"
data-cy="circle-has-picture"
draggable="false"
/>
<UiSatelliteCircle
v-else-if="type === 'random'"
Expand Down
5 changes: 3 additions & 2 deletions components/ui/Circle/Circle.less
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
.circle {
&:extend(.font-secondary);
&:extend(.no-select);
display: inline-block;
vertical-align: top;
.image {
&:extend(.full-width);
height: @full;
}
display: inline-block;
vertical-align: top;
}

.circle-flex {
Expand Down
2 changes: 1 addition & 1 deletion components/ui/DroppableWrapper/DroppableWrapper.less
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
left: 0;
right: 0;
bottom: 0;
user-select: none;
&:extend(.no-select);
pointer-events: none;
background-color: transparent;
border: 5px solid transparent;
Expand Down
2 changes: 1 addition & 1 deletion components/ui/GlowingCursorArea/GlowingCursorArea.less
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
width: 0px;
height: 0px;
pointer-events: none;
user-select: none;
&:extend(.third-layer);
&:extend(.no-select);
backface-visibility: hidden;
will-change: transform;
box-shadow: 0 0 30px 30px rgba(255, 255, 255, 0.1);
Expand Down
2 changes: 1 addition & 1 deletion components/ui/User/User.less
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
&:extend(.round-corners);
cursor: pointer;
position: relative;
user-select: none;
&:extend(.no-select);
&:extend(.full-width);
align-items: center;
&:extend(.light-padding);
Expand Down
5 changes: 1 addition & 4 deletions components/views/chat/chatbar/Editable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -337,11 +337,8 @@ export default Vue.extend({
overflow: hidden;
left: 0;
right: 0;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
&:extend(.background-layer);
&:extend(.no-select);
}
.editable-input {
Expand Down
3 changes: 1 addition & 2 deletions components/views/chat/chatbar/footer/Footer.less
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@
float: right;
margin-right: 2rem;
font-size: @mini-text-size;
user-select: none;
-webkit-user-select: none;
&:extend(.no-select);
&:extend(.font-muted);
margin-left: auto;
&.is-error {
Expand Down
2 changes: 1 addition & 1 deletion components/views/chat/enhancers/Enhancers.less
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
.emoji-picker .emojis span {
display: inline-block;
cursor: pointer;
user-select: none;
&:extend(.no-select);
padding: 0.2rem;
border-radius: 5px;
}
Expand Down
3 changes: 1 addition & 2 deletions components/views/files/aside/List/List.less
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ li {
align-items: center;
border-radius: @corner-rounding-smaller;
&:extend(.full-width);
-webkit-user-select: none;
user-select: none;
&:extend(.no-select);

&:hover {
background: @foreground;
Expand Down
3 changes: 1 addition & 2 deletions components/views/files/list/List.less
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
&:extend(.full-width);
font-size: @text-size;
background: transparent;
user-select: none;
-webkit-user-select: none;
&:extend(.no-select);
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);

&.disabled {
Expand Down
2 changes: 1 addition & 1 deletion components/views/friends/friend/Friend.less
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
&:extend(.more-pad-sides);
display: flex;
align-items: center;
user-select: none;
&:extend(.no-select);
&:extend(.round-corners);
margin: 0 @light-spacing;
}
2 changes: 1 addition & 1 deletion components/views/group/clickable/Clickable.less
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,6 @@
&:extend(.round-corners);
cursor: pointer;
position: relative;
user-select: none;
&:extend(.no-select);
&:extend(.full-width);
}
2 changes: 1 addition & 1 deletion components/views/message/Friend.less
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,6 @@
&:extend(.round-corners);
cursor: pointer;
position: relative;
user-select: none;
&:extend(.no-select);
&:extend(.full-width);
}
2 changes: 1 addition & 1 deletion components/views/navigation/toolbar/Toolbar.less
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@
max-width: 250px;
overflow: hidden;
text-overflow: ellipsis;
user-select: none;
&:extend(.no-select);
pointer-events: none;

.title {
Expand Down
2 changes: 1 addition & 1 deletion components/views/user/User.less
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,6 @@
&:extend(.round-corners);
cursor: pointer;
position: relative;
user-select: none;
&:extend(.no-select);
&:extend(.full-width);
}
2 changes: 1 addition & 1 deletion layouts/Layout.less
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

#app {
display: flex;
user-select: none;
&:extend(.no-select);
height: var(--app-height);

.swiper {
Expand Down

0 comments on commit 2f86b32

Please sign in to comment.