question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Box text field focuses only when clicked on input

See original GitHub issue

Steps to reproduce

Create <v-text-field box> as in codepen, try to focus the input by clicking the field outside the blue area

Versions

0.15.7

What is expected ?

Clicking the box field in any place (with pointer cursor) should focus the input

What is actually happening ?

Input focuses only when the blue area is clicked (although the hover area is bigger)

Reproduction Link

https://codepen.io/anon/pen/aLZJVP

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:10 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
nkovacscommented, Feb 22, 2018

Textareas can be fixed using this css:

.input-group--text-field.input-group--textarea:not(.input-group--full-width) .input-group__input {
    padding: 0;
    textarea {
        padding: 30px 0 0 13px;
    }
}

The other inputs can also be fixed in a similar way, extending their click area to the label’s (transformed) position, e.g.:

.input-group--text-field:not(.input-group--select):not(.input-group--single-line):not(.input-group--text-field-box):not(.input-group--textarea) {
    padding-top: 0; // original is 18px

    input {
        height: 48px;
        padding-top: 18px;
    }

    textarea {
        padding-top: 18px;
    }

    .input-group--text-field.input-group--multi-line textarea {
        padding-top: 22px;
    }
}

Edit: unfortunately, this doesn’t look good when scrolling, because most browsers (excluding Firefox) will let the scrolled text enter the padding. Firefox clips it, so it looks good there.

Or with something like this: https://github.com/nkovacs/vuetify/commit/9d0c164a3718521b43fb8dffd32fe8981934eff1

0reactions
johnleidercommented, May 7, 2018

We could probably go back and forth, I suggest coming to the community: https://community.vuetifyjs.com and continue the conversation there.

Read more comments on GitHub >

github_iconTop Results From Across the Web

HTML input fields does not get focus when clicked
If I move the cursor over the input field I can see the text cursor, but when I click it the field does...
Read more >
How to Make a Text Field Automatically Active (Set Focus)
When a text field is active it is said to be focused. Setting the focus means making the field active so the cursor...
Read more >
HTMLElement.focus() - Web APIs | MDN
The HTMLElement.focus() method sets focus on the specified element, if it can be focused. The focused element is the element that will ...
Read more >
Set Input Focus with HTML5 autofocus | SamanthaMing.com
Set Input Focus with HTML5 autofocus. Use the autofocus attribute on form elements to automatically focus the input field when the page loads....
Read more >
3 ways to autofocus an input in React that ALMOST always work!
This input is focus ed, but no text is selected. If the user starts typing, the text they type will go into that...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found