Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add auto expand to <mwc-textfield> and <mwc-textarea> #455

Open
1 of 2 tasks
Sebastianhex opened this issue Sep 5, 2019 · 5 comments
Open
1 of 2 tasks

Add auto expand to <mwc-textfield> and <mwc-textarea> #455

Sebastianhex opened this issue Sep 5, 2019 · 5 comments
Labels
Type: Feature New feature or request

Comments

@Sebastianhex
Copy link

Sebastianhex commented Sep 5, 2019

I'm submitting a

  • bug report
  • feature request

Proposed Properties/Attributes

Name Type Description
autoExpand boolean Overflow text causes the input container to automatically expand by adding visible rows.
maxRows number Note: requires autoExpand to be set. Maximum number of visible text lines.

Example

<mwc-textfield label="Label" autoExpand maxRows="2"></mwc-textfield>

Expected behaviour

Other information

This behaviour is described under multi-line fields within the Material Design guidelines.

@e111077
Copy link
Contributor

e111077 commented Sep 16, 2019

Not implemented in mdc. Not against it, but the spec is low on details on the outlined variant of this. Will need to get more info from designers

@rwestlund
Copy link

Any update on this? I have a need for it as well.

Here's my current hack: I have <mwc-textarea id="textarea" @input="${this.resize}">

async resize() {                                                               
    const outer = this.shadowRoot.getElementById("textarea");                      
    const inner = outer.shadowRoot.getElementById("text-field");               
    outer.rows = 3;                                                            
    await null;                                                                
    while (inner.scrollHeight > inner.offsetHeight) {                          
        outer.rows = outer.rows + 1;                                           
        await null;                                                            
    }                                                                          
} 

@e111077
Copy link
Contributor

e111077 commented Jan 15, 2020

Hello, currently no update as most of our efforts are put into getting select out and architectural reworkings.

@davebernardy
Copy link

Any update on this one?

@e111077 e111077 assigned asyncLiz and unassigned e111077 Sep 23, 2020
@asyncLiz
Copy link
Collaborator

There is no update, we will post in this issue if there is one.

@asyncLiz asyncLiz removed their assignment Sep 23, 2020
@asyncLiz asyncLiz self-assigned this Jul 13, 2023
@asyncLiz asyncLiz removed their assignment Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Feature New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants