royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [royale-asjs] branch develop updated: Disabling an element still allowed tabbing in.
Date Mon, 13 Nov 2017 11:57:08 GMT
This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new ae38693  Disabling an element still allowed tabbing in.
ae38693 is described below

commit ae386934a59179ccd5b9ada0dd8bc55875769f1c
Author: Harbs <harbs@in-tools.com>
AuthorDate: Mon Nov 13 13:57:02 2017 +0200

    Disabling an element still allowed tabbing in.
---
 .../org/apache/royale/html/beads/DisableBead.as    | 24 ++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DisableBead.as
b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DisableBead.as
index 9b66b83..772c25d 100644
--- a/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DisableBead.as
+++ b/frameworks/projects/Basic/src/main/royale/org/apache/royale/html/beads/DisableBead.as
@@ -32,6 +32,7 @@ package org.apache.royale.html.beads
 
 	COMPILE::JS{
 		import org.apache.royale.core.WrappedHTMLElement;
+		import org.apache.royale.core.HTMLElementWrapper;
 	}
 	/**
 	 *  The DisableBead class is a specialty bead that can be used with
@@ -83,11 +84,17 @@ package org.apache.royale.html.beads
 		
 		/**
 		 *  @private
+		 *  @royaleignorecoercion org.apache.royale.core.HTMLElementWrapper
 		 */
 		public function set disabled(value:Boolean):void
 		{
 			if (value != _disabled)
 			{
+				COMPILE::JS
+				{
+					if(value && _strand)
+						_lastTabVal = (_strand as HTMLElementWrapper).element.getAttribute("tabindex");
+				}
 				_disabled = value;
 				updateHost();
 				throwChangeEvent();
@@ -103,7 +110,13 @@ package org.apache.royale.html.beads
 		{
 			return _strand as IUIBase;
 		}
-
+		
+		COMPILE::JS
+		private var _lastTabVal:String;
+		
+		/**
+		 * @royaleignorecoercion org.apache.royale.core.HTMLElementWrapper
+		 */
 		private function updateHost():void
 		{
 			if(!_strand)//bail out
@@ -114,7 +127,14 @@ package org.apache.royale.html.beads
 			}
 			
 			COMPILE::JS {
-				(_strand as Object).element.style.pointerEvents = disabled ? "none" : "";
+				var elem:HTMLElement = (_strand as HTMLElementWrapper).element;
+				elem.style["pointerEvents"] = disabled ? "none" : "";
+				if(disabled)
+					elem.setAttribute("tabindex", "-1");
+				else
+					_lastTabVal ?
+						elem.setAttribute("tabindex", _lastTabVal) :
+						elem.removeAttribute("tabindex");
 			}
 				
 		}

-- 
To stop receiving notification emails like this one, please contact
['"commits@royale.apache.org" <commits@royale.apache.org>'].

Mime
View raw message