fix: add task input layout on mobile #1615

Merged
konrad merged 3 commits from fix/add-task-mobile into main 2022-03-27 20:37:26 +00:00
1 changed files with 30 additions and 9 deletions

View File

@ -5,6 +5,7 @@
<textarea
:disabled="taskService.loading || undefined"
class="add-task-textarea input"
:class="{'textarea-empty': newTaskTitle === ''}"
:placeholder="$t('list.list.addPlaceholder')"
rows="1"
v-focus
@ -24,8 +25,11 @@
@click="addTask()"
icon="plus"
:loading="taskService.loading"
:aria-label="$t('list.list.add')"
>
<span class="button-text">
{{ $t('list.list.add') }}
</span>
</x-button>
</p>
</div>
@ -59,7 +63,7 @@ function useAutoHeightTextarea(value: MaybeRef<string>) {
let empty
// the value here is the the attribute value
// the value here is the attribute value
if (!textareaEl.value && textareaEl.placeholder) {
empty = true
textareaEl.value = textareaEl.placeholder
@ -200,9 +204,26 @@ function handleEnter(e: KeyboardEvent) {
.add-task-button {
height: 2.5rem;
@media screen and (max-width: $mobile) {
.button-text {
display: none;
}
:deep(.icon) {
margin: 0 !important;
}
}
}
.add-task-textarea {
transition: border-color $transition;
resize: none;
}
// Adding this class when the textarea has no text prevents the textarea from wrapping the placeholder.
.textarea-empty {
white-space: nowrap;
text-overflow: ellipsis;
}
</style>