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

Update textfield label position when value is changed from JavaScript #822

Closed
jesperkristensen opened this issue Jun 14, 2017 · 14 comments
Closed

Comments

@jesperkristensen
Copy link

What MDC-Web Version are you using?

Not sure. Neither material-components-web.min.js nor material-components-web.css seem to contain a version number. But the issue looks to be the same on the master branch of this repository.

What browser(s) is this bug affecting?

Tested on Firefox 54 and Chrome 59.

What OS are you using?

Windows 10

What are the steps to reproduce the bug?

I am using MDC-Web together with Angular (v1) following this guide:
https://material.io/components/web/docs/framework-integration/
And specifically this link from the guide:
https://plnkr.co/edit/b4v160c186ErrPG5vNza?p=preview

I have a MDC Textfield as described in the guide above.
When the value of the text field is updated from JavaScript via Angular, the position of the label does not change to reflect if the text field is empty or not.

  1. open https://plnkr.co/edit/EMfKHSByb2Z7VaxBOS3K?p=preview
  2. Type something in the second text box (the one that is not MDC styled)
  3. Observe that the MDC styled input is updated, but the label and the value overlap each other.

When I look at https://github.com/material-components/material-components-web/blob/master/packages/mdc-textfield/foundation.js it seems to set LABEL_FLOAT_ABOVE when the component is loaded and when focus is lost.
But there does not seem to be a way to tell it that the value has been changed from JavaScript, which should update LABEL_FLOAT_ABOVE.

What is the expected behavior?

There should be some API or other way for the framework to tell the component that the text field value has changed, and it should update its label position to match the updated value.

What is the actual behavior?

The field value and the field label are written on top of each other, making them unreadable.

Any other information you believe would be useful?

@traviskaufman
Copy link
Contributor

This does seem like a bug. One possible solution is to simply override the value property on the native text inputs for textboxes, similar to what we do for MDCCheckbox. Thanks for reporting!

@leefernandes
Copy link

In the meantime I'm working around this by using a custom label float class to keep the label affixed above.

.mdc-textfield__label--float-above-fixed {
  transform: translateY(-100%) scale(0.75, 0.75);
  cursor: auto;
}

@JordyvA
Copy link

JordyvA commented Sep 20, 2017

Same problem over here. When I manipulate the value in Javascript and set the value over there, the label stays on top of the value. When I click the inputfield (so it get's focus), the label comes above the value.

@thomasklein
Copy link

thomasklein commented Oct 10, 2017

Hi guys! The above PR is already hanging around for a while...

@gjdev
Copy link
Contributor

gjdev commented Oct 16, 2017

Since my issue was closed as a duplicate, I'd like to add some info:

AFAIK this issue currently only mentions the label-float style after a programmatic change of the input value. However, a change of the input value may affect other styles when the new value introduces or fixes a previous input value error. Hence value changes may also affect the error styles, helptext, and errortext.

@lynnmercier
Copy link
Contributor

I want to start by apologizing for #1197 unreviewed for so long. We've done a lot of changes around text field lately, and we let this PR slip.

I took a look at the PR, and it's really helped me understand how complicated MDC Textfield really is. There are labels which float and shake...and the invalid states...and the custom validity feature.

Here's what I propose, and I'm hoping @anton-kachurin can help make a PR for this

  1. create a new private method updateLabelFloat_
  • The LABEL_FLOAT_ABOVE CSS class should only be present if the text field is focused, and the input has value. updateLabelFloat will check for these conditions, and add/remove the CSS class.
  • Then replace all references to LABEL_FLOAT_ABOVE within the Foundation code...with a call to updateLabelFloat
  1. update changeValidity_ to check if the text field is focused, before adding the LABEL_SHAKE
  2. create new private method updateDefaultValidity_
  • This method will execute this.changeValidity_(input.checkValidity());
  • Then update deactivateFocus_ to call updateDefaultValidity (line 235)
  1. create a new public method setValue
  • This method will update the input's value
  • Then it will call updateLabelFloat
  • Then it will call updateDefaultValidity IF the if (!this.useCustomValidityChecking_)

This PR will leave MDC Textfield with the following public methods

  • setValue
  • setValid (only used by clients who want custom validity checking)

Any time a client wants to change the Textfield's value through JavaScript, that client should call call setValue. And if that client also uses custom validity checking, they should also call setValid

...I realize this proposal is pretty different from #1197. My concern with #1197 is listening to an input property changes. I worry that might not always work across all browsers. I think if a client already wants to set the input value through JavaScript, they should instead be able to set the value through MDC Textfield's setValue.

@acdvorak
Copy link
Contributor

I agree with @lynnjepsen.

In addition, I think we should also listen for input and change events and call setValue() in response. This is necessary to support form fillers like Chrome, 1Password, LastPass, etc.

In my eyes, supporting form fillers is an absolute 100% must. Neglecting them does a tremendous disservice to countless users.

@anton-kachurin
Copy link
Contributor

anton-kachurin commented Oct 19, 2017

@lynnjepsen How about all of the above plus hook the value property of the input and call setValue() internally? The hook will need to contain something like if (!this.setValueIsProcessing_) this.setValue(newValue) to avoid getting into an endless loop.

There's too much code that manipulates input's value property directly, we can't just ignore it. Many developers are going to need some solution that allows to maintain proper look of the MDCTextfield after the value property of the native input has been changed.

To provide compatibility with different libraries, plugins, browser extensions, etc, third-party developers are now and will be in the future forced to create workarounds, and these workarounds aren't easy to maintain because "there are labels which float and shake...and the invalid states...and the custom validity feature" and the MDCTexfield component is very far from implementing the spec to its fullest yet.

I totally understand and agree with that property hooks are not ideal from the perspective of the browser support. Older versions of Safari and some mobile browsers do not support it, and IE is being glitchy in some cases. But browser support will get only better over time.

Also, similar functionality is implemented through property hooks in MDCCheckbox. Consistency is important too, in my opinion.

@lynnmercier
Copy link
Contributor

Hmm I hadn't noticed MDC Checkbox doing the same thing. That's very interesting.

We're going to spend a little time doing browser testing of MDC Checkbox...and depending on how that goes we'll update this thread with more information about how to handle MDC Textfield.

@lynnmercier
Copy link
Contributor

MDC Checkbox seems to work fine on all browsers.

So I think @anton-kachurin, you're right. Do all the above plus hook the value property of the input and call setValue() internally

@anton-kachurin
Copy link
Contributor

anton-kachurin commented Oct 29, 2017

Will do. Also, I'd like #1503 to be validated. There is a chance that the issue is associated with some property hooking flaws in IE. Update: That issue is not related to property hooking.

@lynnmercier
Copy link
Contributor

Ya..........how about you change #1197 to only cover:

  • create a new private method updateLabelFloat_
  • update changeValidity_ to check if the text field is focused, before adding the LABEL_SHAKE
  • create new private method updateDefaultValidity_
  • create a new public method setValue

and then we will all figure out a follow up PR to cover the property hooks. Hopefully by then we can investigate the IE side of things more within the context of MDC Checkbox, and can provide some guidance

@anton-kachurin
Copy link
Contributor

anton-kachurin commented Nov 6, 2017

Working on it. Some progress may be seen in #1197 but that's not a final version. Still need to:

  1. Add tests for the new public setValue method
  2. Add docs for it

By the way, since we are adding a public method to the foundation, seems reasonable to add:

  1. A new public getValue to the foundation
  2. MDCTextfield.value property to the Textfield API

WDYT?

@lynnmercier
Copy link
Contributor

Added

A new public getValue to the foundation
and
MDCTextfield.value property to the Textfield API

in #1873

acdvorak pushed a commit that referenced this issue Dec 14, 2018
## The devDependency [css-loader](https://github.com/webpack-contrib/css-loader) was updated from `1.0.1` to `2.0.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

<details>
<summary>Release Notes for v2.0.0</summary>

<p><a name="user-content-2.0.0"></a></p>
<h1><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/compare/v1.0.1...v2.0.0">2.0.0</a> (2018-12-07)</h1>
<p>The main <strong>BREAKING CHANGES</strong>:</p>
<ul>
<li>css modules <strong>are disabled by default</strong>, you need setup their use <code>modules</code> option. You can setup their using <code>local</code> (<code>true</code> is alias for this value) and <code>global</code> (previous behaviour) value. Why it is disabled by default? A lot of developers use <code>css</code> without css modules features and they get performance problems due <code>postcss</code> plugins spend time on analyze and processing file.</li>
<li>resolving logic for <code>uls()</code> and <code>import</code> at-rules works the same everywhere, it does not matter whether css modules are enabled (with <code>global</code> and <code>local</code> module) or not. Examples - <code>url('image.png')</code> as <code>require('./image.png')</code>, <code>url('./image.png')</code> as <code>require('./image.png')</code>, <code>url('~module/image.png')</code> as <code>require('module/image.png')</code>.</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>broken unucode characters (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/850" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/850/hovercard">#850</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f599c70">f599c70</a>)</li>
<li>correctly processing <code>urls()</code> with <code>?#hash</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/803" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/803/hovercard">#803</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/417d105">417d105</a>)</li>
<li>don't break loader on invalid or not exists url or import token (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/827" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/827/hovercard">#827</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9e52d26">9e52d26</a>)</li>
<li>don't duplicate import with same media in different case (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/819" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/819/hovercard">#819</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9f66e33">9f66e33</a>)</li>
<li>emit warnings on broken <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/806" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/806/hovercard">#806</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/4bdf08b">4bdf08b</a>)</li>
<li>handle uppercase <code>URL</code> in <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/818" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/818/hovercard">#818</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/3ebdcd5">3ebdcd5</a>)</li>
<li>inconsistent generate class names for css modules on difference os (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/812" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/812/hovercard">#812</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/0bdf9b7">0bdf9b7</a>)</li>
<li>reduce number of <code>require</code> for <code>urls()</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/854" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/854/hovercard">#854</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/3338656">3338656</a>)</li>
<li>support deduplication of string module ids (optimization.namedModules) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/789" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/789/hovercard">#789</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e3bb83a">e3bb83a</a>)</li>
<li>support module resolution in <code>composes</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/845" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/845/hovercard">#845</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/453248f">453248f</a>)</li>
<li>same <code>urls()</code> resolving logic for <code>modules</code> (<code>local</code> and <code>global</code>) and without modules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/843" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/843/hovercard">#843</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/fdcf687">fdcf687</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>allow to disable css modules and <strong>disable their by default</strong> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/842" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/842/hovercard">#842</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/889dc7f">889dc7f</a>)</li>
<li>disable <code>import</code> option doesn't affect on <code>composes</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/822" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/822/hovercard">#822</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f9aa73c">f9aa73c</a>)</li>
<li>allow to filter <code>urls</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/856" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/856/hovercard">#856</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e702e7">5e702e7</a>)</li>
<li>allow to filter <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/857" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/857/hovercard">#857</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e6034c">5e6034c</a>)</li>
<li>emit warning on invalid <code>urls()</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/832" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/832/hovercard">#832</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/da95db8">da95db8</a>)</li>
<li>added <code>exportOnlyLocals</code> option (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/824" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/824/hovercard">#824</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e9327c0">e9327c0</a>)</li>
<li>reuse <code>postcss</code> ast from other loaders (i.e <code>postcss-loader</code>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/840" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/840/hovercard">#840</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/1dad1fb">1dad1fb</a>)</li>
<li>schema options (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/b97d997">b97d997</a>)</li>
</ul>
<h3>BREAKING CHANGES</h3>
<ul>
<li>resolving logic for <code>uls()</code> and <code>import</code> at-rules works the same everywhere, it does not matter whether css modules are enabled (with <code>global</code> and <code>local</code> module) or not. Examples - <code>url('image.png')</code> as <code>require('./image.png')</code>, <code>url('./image.png')</code> as <code>require('./image.png')</code>, <code>url('~module/image.png')</code> as <code>require('module/image.png')</code>.</li>
<li>by default css modules are disabled (now <code>modules: false</code> disable all css modules features), you can return old behaviour change this on <code>modules: 'global'</code></li>
<li><code>css-loader/locals</code> was dropped in favor <code>exportOnlyLocals</code> option</li>
<li><code>import</code> option only affect on <code>import</code> at-rules and doesn't affect on <code>composes</code> declarations</li>
<li>invalid <code>@import</code> at rules now emit warnings</li>
<li>use <code>postcss@7</code></li>
</ul>
<h3>Bonus</h3>
<ul>
<li>code refactoring, updating deps and reusing <code>postcss</code> ast increase performance</li>
</ul>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 67 commits.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/634ab49c17b284e55e62105109412ebd37e234b5"><code>634ab49</code></a> <code>chore(release): 2.0.0</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/6ade2d0e7c04031c79841f1f741d986430a5aed7"><code>6ade2d0</code></a> <code>refactor: remove unused file (#860)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e7525c90718018b75321f1e04909d6937b6ad140"><code>e7525c9</code></a> <code>test: nested url (#859)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/7259faa89dc70830d69b7eb7baf4163065b63679"><code>7259faa</code></a> <code>test: css hacks (#858)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e6034cee840d47dbfd9fdede87a152e4cfc466a"><code>5e6034c</code></a> <code>feat: allow to filter import at-rules (#857)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e702e7d2e081b7f6d372f0c967fdfca6a40a584"><code>5e702e7</code></a> <code>feat: allow filtering urls (#856)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9642aa5ad70282f5a7bef8e95ceefdc834af1af1"><code>9642aa5</code></a> <code>test: css stuff (#855)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/333865645e21c15e8589724317111d9d6badbeba"><code>3338656</code></a> <code>fix: reduce number of require for url (#854)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/533abbe8cf2b937751f3d4501816611a230083d2"><code>533abbe</code></a> <code>test: issue 636 (#853)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/08c551cc78bb484a4f947047cbc46b305e733d7e"><code>08c551c</code></a> <code>refactor: better warning on invalid url resolution (#852)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/b0aa159cbb951774a2c09b37f093dd95d23ebbd3"><code>b0aa159</code></a> <code>test: issue #589 (#851)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f599c7087466ca293989531805ef367b388d13f1"><code>f599c70</code></a> <code>fix: broken unucode characters (#850)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/1e551f338bf6a22541e3dab7943429b01cae02ab"><code>1e551f3</code></a> <code>test: issue 286 (#849)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/419d27b0836be683a1f0cc786ec47e7f80617842"><code>419d27b</code></a> <code>docs: improve readme (#848)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/d94a698d9d144fb91a9d1fdfb8cd4433e410e70e"><code>d94a698</code></a> <code>refactor: webpack-default (#847)</code></li>
</ul>
<p>There are 67 commits in total.</p>
<p>See the <a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/compare/10c3bc31bedcfffe35a8e65e82397d4dd632f6c0...634ab49c17b284e55e62105109412ebd37e234b5">full diff</a></p>
</details>

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴
adrianschmidt pushed a commit to Lundalogik/material-components-web that referenced this issue Jan 4, 2019
…#4153)

## The devDependency [css-loader](https://github.com/webpack-contrib/css-loader) was updated from `1.0.1` to `2.0.0`.
This version is **not covered** by your **current version range**.

If you don’t accept this pull request, your project will work just like it did before. However, you might be missing out on a bunch of new features, fixes and/or performance improvements from the dependency update.

---

<details>
<summary>Release Notes for v2.0.0</summary>

<p><a name="user-content-2.0.0"></a></p>
<h1><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/compare/v1.0.1...v2.0.0">2.0.0</a> (2018-12-07)</h1>
<p>The main <strong>BREAKING CHANGES</strong>:</p>
<ul>
<li>css modules <strong>are disabled by default</strong>, you need setup their use <code>modules</code> option. You can setup their using <code>local</code> (<code>true</code> is alias for this value) and <code>global</code> (previous behaviour) value. Why it is disabled by default? A lot of developers use <code>css</code> without css modules features and they get performance problems due <code>postcss</code> plugins spend time on analyze and processing file.</li>
<li>resolving logic for <code>uls()</code> and <code>import</code> at-rules works the same everywhere, it does not matter whether css modules are enabled (with <code>global</code> and <code>local</code> module) or not. Examples - <code>url('image.png')</code> as <code>require('./image.png')</code>, <code>url('./image.png')</code> as <code>require('./image.png')</code>, <code>url('~module/image.png')</code> as <code>require('module/image.png')</code>.</li>
</ul>
<h3>Bug Fixes</h3>
<ul>
<li>broken unucode characters (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/850" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/850/hovercard">material-components#850</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f599c70">f599c70</a>)</li>
<li>correctly processing <code>urls()</code> with <code>?#hash</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/803" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/803/hovercard">material-components#803</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/417d105">417d105</a>)</li>
<li>don't break loader on invalid or not exists url or import token (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/827" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/827/hovercard">material-components#827</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9e52d26">9e52d26</a>)</li>
<li>don't duplicate import with same media in different case (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/819" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/819/hovercard">material-components#819</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9f66e33">9f66e33</a>)</li>
<li>emit warnings on broken <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/806" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/806/hovercard">material-components#806</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/4bdf08b">4bdf08b</a>)</li>
<li>handle uppercase <code>URL</code> in <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/818" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/818/hovercard">material-components#818</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/3ebdcd5">3ebdcd5</a>)</li>
<li>inconsistent generate class names for css modules on difference os (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/812" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/812/hovercard">material-components#812</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/0bdf9b7">0bdf9b7</a>)</li>
<li>reduce number of <code>require</code> for <code>urls()</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/854" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/854/hovercard">material-components#854</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/3338656">3338656</a>)</li>
<li>support deduplication of string module ids (optimization.namedModules) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/789" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/789/hovercard">material-components#789</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e3bb83a">e3bb83a</a>)</li>
<li>support module resolution in <code>composes</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/845" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/845/hovercard">material-components#845</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/453248f">453248f</a>)</li>
<li>same <code>urls()</code> resolving logic for <code>modules</code> (<code>local</code> and <code>global</code>) and without modules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/843" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/843/hovercard">material-components#843</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/fdcf687">fdcf687</a>)</li>
</ul>
<h3>Features</h3>
<ul>
<li>allow to disable css modules and <strong>disable their by default</strong> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/842" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/842/hovercard">material-components#842</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/889dc7f">889dc7f</a>)</li>
<li>disable <code>import</code> option doesn't affect on <code>composes</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/822" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/822/hovercard">material-components#822</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f9aa73c">f9aa73c</a>)</li>
<li>allow to filter <code>urls</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/856" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/856/hovercard">material-components#856</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e702e7">5e702e7</a>)</li>
<li>allow to filter <code>import</code> at-rules (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/857" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/857/hovercard">material-components#857</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e6034c">5e6034c</a>)</li>
<li>emit warning on invalid <code>urls()</code> (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/832" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/832/hovercard">material-components#832</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/da95db8">da95db8</a>)</li>
<li>added <code>exportOnlyLocals</code> option (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/824" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/824/hovercard">material-components#824</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e9327c0">e9327c0</a>)</li>
<li>reuse <code>postcss</code> ast from other loaders (i.e <code>postcss-loader</code>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/issues/840" data-hovercard-type="pull_request" data-hovercard-url="/webpack-contrib/css-loader/pull/840/hovercard">material-components#840</a>) (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/1dad1fb">1dad1fb</a>)</li>
<li>schema options (<a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/b97d997">b97d997</a>)</li>
</ul>
<h3>BREAKING CHANGES</h3>
<ul>
<li>resolving logic for <code>uls()</code> and <code>import</code> at-rules works the same everywhere, it does not matter whether css modules are enabled (with <code>global</code> and <code>local</code> module) or not. Examples - <code>url('image.png')</code> as <code>require('./image.png')</code>, <code>url('./image.png')</code> as <code>require('./image.png')</code>, <code>url('~module/image.png')</code> as <code>require('module/image.png')</code>.</li>
<li>by default css modules are disabled (now <code>modules: false</code> disable all css modules features), you can return old behaviour change this on <code>modules: 'global'</code></li>
<li><code>css-loader/locals</code> was dropped in favor <code>exportOnlyLocals</code> option</li>
<li><code>import</code> option only affect on <code>import</code> at-rules and doesn't affect on <code>composes</code> declarations</li>
<li>invalid <code>@import</code> at rules now emit warnings</li>
<li>use <code>postcss@7</code></li>
</ul>
<h3>Bonus</h3>
<ul>
<li>code refactoring, updating deps and reusing <code>postcss</code> ast increase performance</li>
</ul>
</details>

<details>
<summary>Commits</summary>
<p>The new version differs by 67 commits.</p>
<ul>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/634ab49c17b284e55e62105109412ebd37e234b5"><code>634ab49</code></a> <code>chore(release): 2.0.0</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/6ade2d0e7c04031c79841f1f741d986430a5aed7"><code>6ade2d0</code></a> <code>refactor: remove unused file (material-components#860)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/e7525c90718018b75321f1e04909d6937b6ad140"><code>e7525c9</code></a> <code>test: nested url (material-components#859)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/7259faa89dc70830d69b7eb7baf4163065b63679"><code>7259faa</code></a> <code>test: css hacks (material-components#858)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e6034cee840d47dbfd9fdede87a152e4cfc466a"><code>5e6034c</code></a> <code>feat: allow to filter import at-rules (material-components#857)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/5e702e7d2e081b7f6d372f0c967fdfca6a40a584"><code>5e702e7</code></a> <code>feat: allow filtering urls (material-components#856)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/9642aa5ad70282f5a7bef8e95ceefdc834af1af1"><code>9642aa5</code></a> <code>test: css stuff (material-components#855)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/333865645e21c15e8589724317111d9d6badbeba"><code>3338656</code></a> <code>fix: reduce number of require for url (material-components#854)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/533abbe8cf2b937751f3d4501816611a230083d2"><code>533abbe</code></a> <code>test: issue 636 (material-components#853)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/08c551cc78bb484a4f947047cbc46b305e733d7e"><code>08c551c</code></a> <code>refactor: better warning on invalid url resolution (material-components#852)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/b0aa159cbb951774a2c09b37f093dd95d23ebbd3"><code>b0aa159</code></a> <code>test: issue material-components#589 (material-components#851)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/f599c7087466ca293989531805ef367b388d13f1"><code>f599c70</code></a> <code>fix: broken unucode characters (material-components#850)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/1e551f338bf6a22541e3dab7943429b01cae02ab"><code>1e551f3</code></a> <code>test: issue 286 (material-components#849)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/419d27b0836be683a1f0cc786ec47e7f80617842"><code>419d27b</code></a> <code>docs: improve readme (material-components#848)</code></li>
<li><a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/commit/d94a698d9d144fb91a9d1fdfb8cd4433e410e70e"><code>d94a698</code></a> <code>refactor: webpack-default (material-components#847)</code></li>
</ul>
<p>There are 67 commits in total.</p>
<p>See the <a href="https://urls.greenkeeper.io/webpack-contrib/css-loader/compare/10c3bc31bedcfffe35a8e65e82397d4dd632f6c0...634ab49c17b284e55e62105109412ebd37e234b5">full diff</a></p>
</details>

<details>
  <summary>FAQ and help</summary>

  There is a collection of [frequently asked questions](https://greenkeeper.io/faq.html). If those don’t help, you can always [ask the humans behind Greenkeeper](https://github.com/greenkeeperio/greenkeeper/issues/new).
</details>

---


Your [Greenkeeper](https://greenkeeper.io) bot 🌴


(cherry picked from commit 4afb87c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants