Fix input field label selector

Fix clearing input by selection in new media popup
This commit is contained in:
Eduard Kuzmenko 2020-12-18 19:23:08 +02:00
parent e56c729880
commit f387ef8a27
4 changed files with 8 additions and 7 deletions

View File

@ -110,7 +110,7 @@ export default class PopupNewMedia extends PopupElement {
private onKeyDown = (e: KeyboardEvent) => {
const target = e.target as HTMLElement;
if(target.tagName != 'INPUT') {
if(target !== this.input) {
this.input.focus();
placeCaretAtEnd(this.input);
}

View File

@ -248,6 +248,7 @@ export class AppMessagesManager {
if(removeUnread && dialog.unread_count) dialog.unread_count -= removeUnread;
dialog.unread_count = Math.max(0, dialog.unread_count);
dialogs.push(dialog);
appStateManager.setPeer(dialog.peerId, appPeersManager.getPeer(dialog.peerId));

View File

@ -95,7 +95,7 @@
&.error {
border-color: $color-error;
& + label {
& ~ label {
color: $color-error!important;
}
}
@ -103,7 +103,7 @@
&.valid {
border-color: #26962F;
& + label {
& ~ label {
color: #26962F !important;
}
}
@ -119,11 +119,11 @@
border-color: $button-primary-background;
}
&:focus + label {
&:focus ~ label {
color: $button-primary-background;
}
&:focus + label, &:valid + label, &:not(:empty) + label, &:disabled + label {
&:focus ~ label, &:valid ~ label, &:not(:empty) ~ label, &:disabled ~ label {
top: -.5rem;
transform: none;
padding: 0 5px;
@ -217,7 +217,7 @@ input:focus, button:focus {
background-color: transparent;
border-color: $button-primary-background;
& + .tgico {
& ~ .tgico {
color: $button-primary-background;
opacity: 1;
}

View File

@ -141,7 +141,7 @@
font-size: 1rem;
border-radius: $border-radius-medium;
&:not(:focus):empty + label {
&:not(:focus):empty ~ label {
opacity: 0;
}
}