Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Added text area support for mdTextFloat directive #534

Closed
wants to merge 1 commit into from

Conversation

EnoF
Copy link
Contributor

@EnoF EnoF commented Nov 4, 2014

  • Extracted the link function of the mdInputDirective to reuse it for the mdTextareaDirective
    -mdTextarea is configurable with rows and cols, but behaves the same as mdInput

- Extracted the link function of the `mdInputDirective` to reuse it for the `mdTextareaDirective`
-`mdTextarea` is configurable with `rows` and `cols`, but behaves the same as `mdInput`
@vergun
Copy link

vergun commented Nov 4, 2014

LGTM, once the tests pass let's merge

@EnoF
Copy link
Contributor Author

EnoF commented Nov 5, 2014

Awesome, but am I supposed to do something different? I don't think I can do something about this error:

-- Pushing to bower-material...
remote: Invalid username or password.
fatal: Authentication failed for 'https://angular:@github.com/angular/bower-material/'
The command "./scripts/travis-build-init.sh --sha=$TRAVIS_COMMIT" exited with 128.

@erbear
Copy link

erbear commented Nov 5, 2014

I wonder, what is the point of copying mdInputDirective if you can add

template: function(element, attr){
      isTextarea = element.parent().attr('type') == "multiline";

      if (isTextarea)
        return '<textarea rows="1"></textarea>'
      else
        return '<input>'
    }

to mdInputDirective template field
With this solution, textarea will look like input, with autoexpanding feature to add

@marcysutton
Copy link
Contributor

This needs to be tested for accessibility and reviewed by the team before being merged to master.

@ajoslin
Copy link
Contributor

ajoslin commented Nov 6, 2014

@EnoF I just fixed Travis trying to push on pull requests. If you force-push again it will pass properly.

I don't think this approach for inputs and textareas that we're taking now is going to work in the long-term though ... I'll open a separate issue about it.

@erbear I'm a big fan of your idea! This is something that we should take a look at.

@ajoslin
Copy link
Contributor

ajoslin commented Nov 6, 2014

Opened #547.

I want to fix this problem before we add textarea too. Thanks for the contribution, but we won't end up going with this approach.

@ajoslin ajoslin closed this Nov 6, 2014
@EnoF EnoF changed the title Added new directive mdTextarea Added text area support for mdTextFloat directive Nov 6, 2014
@EnoF
Copy link
Contributor Author

EnoF commented Nov 6, 2014

@erbear I wasn't aware of this way of adding a template :)

New implementation:

<md-text-float rows="4" cols="50"
                            type="textarea"
                            label="{{labels.intro}}"
                            ng-model="user.intro">

Should I create a new issue or can we reopen this ticket?
New commit sha: d41be52

@marcysutton marcysutton mentioned this pull request Nov 6, 2014
@EnoF EnoF mentioned this pull request Nov 7, 2014
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants