Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(182)

Unified Diff: samples/third_party/todomvc/web/editable_label.dart

Issue 29823005: fixes to polymer, gets tests back to a stable state (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « samples/third_party/todomvc/test/markdone_test.dart ('k') | samples/third_party/todomvc/web/todo_row.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: samples/third_party/todomvc/web/editable_label.dart
diff --git a/samples/third_party/todomvc/web/editable_label.dart b/samples/third_party/todomvc/web/editable_label.dart
index af8abba96b2baaf5ad453a6eab3e7453e25cc3d4..b6338330218731e6898b3631b8efec25df3f9932 100644
--- a/samples/third_party/todomvc/web/editable_label.dart
+++ b/samples/third_party/todomvc/web/editable_label.dart
@@ -25,19 +25,21 @@ class EditableLabel extends PolymerElement {
bool get applyAuthorStyles => true;
- InputElement get _editBox => getShadowRoot("editable-label").query('#edit');
+ ShadowRoot get _shadowRoot => getShadowRoot('editable-label');
+
+ InputElement get _editBox => _shadowRoot.query('#edit');
void edit() {
editing = true;
- // This causes _editBox to be inserted.
- performMicrotaskCheckpoint();
-
- // For IE and Firefox: use .focus(), then reset the value to move the
- // cursor to the end.
- _editBox.focus();
- _editBox.value = '';
- _editBox.value = value;
+ // Wait for _editBox to be inserted.
+ onMutation(_shadowRoot, (_) {
+ // For IE and Firefox: use .focus(), then reset the value to move the
+ // cursor to the end.
+ _editBox.focus();
+ _editBox.value = '';
+ _editBox.value = value;
+ });
}
void update(Event e) {
« no previous file with comments | « samples/third_party/todomvc/test/markdone_test.dart ('k') | samples/third_party/todomvc/web/todo_row.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698