OLD | NEW |
1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 part of touch; | 5 part of touch; |
6 | 6 |
7 /** | 7 /** |
8 * Common events related helpers. | 8 * Common events related helpers. |
9 */ | 9 */ |
10 class EventUtil { | 10 class EventUtil { |
(...skipping 15 matching lines...) Expand all Loading... |
26 element.onBlur.listen((e) { subscription.cancel(); }); | 26 element.onBlur.listen((e) { subscription.cancel(); }); |
27 } | 27 } |
28 } | 28 } |
29 | 29 |
30 /** | 30 /** |
31 * Clear the keyboard focus of the currently focused element (if there is | 31 * Clear the keyboard focus of the currently focused element (if there is |
32 * one). If there is no currently focused element then this function will do | 32 * one). If there is no currently focused element then this function will do |
33 * nothing. For most browsers this will cause the keyboard to be dismissed. | 33 * nothing. For most browsers this will cause the keyboard to be dismissed. |
34 */ | 34 */ |
35 static void blurFocusedElement() { | 35 static void blurFocusedElement() { |
36 Element focusedEl = document.query("*:focus"); | 36 Element focusedEl = document.querySelector("*:focus"); |
37 if (focusedEl != null) { | 37 if (focusedEl != null) { |
38 focusedEl.blur(); | 38 focusedEl.blur(); |
39 } | 39 } |
40 } | 40 } |
41 } | 41 } |
OLD | NEW |