Chromium Code Reviews| Index: chrome/browser/resources/settings/languages_page/edit_dictionary_page.js |
| diff --git a/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js b/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js |
| index b276bf483fce906e43f5b345db7d3e6f8173ba80..ba0acc7c2ebef8d3a80f909916bd294e81d888dd 100644 |
| --- a/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js |
| +++ b/chrome/browser/resources/settings/languages_page/edit_dictionary_page.js |
| @@ -122,6 +122,15 @@ Polymer({ |
| if (index == -1) { |
| this.languageSettingsPrivate.addSpellcheckWord(word); |
| this.unshift('words_', word); |
| + if (this.words_.length == 1) { |
| + // When adding a word to an _empty_ list, the template is expanded. This |
|
hcarmona
2017/04/10 23:19:39
nit: "This" is on both lines.
dschuyler
2017/04/10 23:26:23
Done.
|
| + // This a workaround to resize the iron-list as well. |
| + // TODO(dschuyler): Remove this hack after iron-list no longer needs |
| + // this workaround to update the list at the same time the template |
| + // wrapping the list is expanded. |
| + Polymer.dom.flush(); |
|
hcarmona
2017/04/10 22:35:07
Do you need both |flush| and iron-resize?
dschuyler
2017/04/10 23:13:57
Without the flush, the #list is not there to be fo
hcarmona
2017/04/10 23:19:39
Sounds good.
|
| + this.$$('#list').fire('iron-resize'); |
|
hcarmona
2017/04/10 22:35:07
this.$.list.fire(...)
dschuyler
2017/04/10 23:13:57
$ doesn't find the id, while $$ will find the id.
hcarmona
2017/04/10 23:19:39
Sounds good, I missed that this is in a dom-if.
|
| + } |
| } |
| }, |