From 97c393ef5abb514b7e3f1404796cd1a2f5cc04d6 Mon Sep 17 00:00:00 2001 From: Andrew Nicols Date: Thu, 13 Feb 2014 09:59:58 +0800 Subject: [PATCH] [widget-modality] Stop trying to focus on the Widget before it is rendered --- src/widget-modality/js/Widget-Modality.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/widget-modality/js/Widget-Modality.js b/src/widget-modality/js/Widget-Modality.js index f280752fc43..aa7bd1efef7 100644 --- a/src/widget-modality/js/Widget-Modality.js +++ b/src/widget-modality/js/Widget-Modality.js @@ -10,6 +10,7 @@ var WIDGET = 'widget', SYNC_UI = 'syncUI', BOUNDING_BOX = 'boundingBox', CONTENT_BOX = 'contentBox', + RENDERED = 'rendered', VISIBLE = 'visible', Z_INDEX = 'zIndex', CHANGE = 'Change', @@ -332,7 +333,9 @@ var WIDGET = 'widget', if (isModal) { maskNode.show(); Y.later(1, this, '_attachUIHandlesModal'); - this._focus(); + if (this.get(RENDERED)) { + this._focus(); + } }