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

MDCTextfieldFoundation has no public API to handle programmatic changes to the input value #1430

Closed
gjdev opened this issue Oct 16, 2017 · 1 comment

Comments

@gjdev
Copy link
Contributor

gjdev commented Oct 16, 2017

In a form it sometimes required to programmatically change the value of a textfield user input (e.g. after some other interaction in the form). Currently the MDCTextfieldFoundation only listens to UI changes of the wrapped input element. After a programmatic change of the input value, there is no way to inform the foundation that the input has a new value. Effectively, label(-float), error, and helptext styles/content will not be updated after such changes.

This could be solved in two ways:

  1. Give MDCTextfieldFoundation a method to inform it that that input.value was changed by code, e.g. MDCTextfieldFoundation.updateAfterValueWrite(), or:
  2. Add a registerValueWriteHandler() to the adapter, which integration code can call to inform the foundation of programmatic changes to the input.value.
@kfranqueiro
Copy link
Contributor

I believe this is the same issue as #822 (which has a PR), or it's at least highly related, so we should probably discuss there if there are additional concerns.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants