-
Bug
-
Resolution: Fixed
-
Normal
-
8.0.5, 9.5.1.2
-
Security Level: Jimmy
Steps to Reproduce
click "with autodisable"
after ZK-4866, try this case: https://zkfiddle.org/sample/1vi7oet/1-focus-with-autodisable
Current Result
the button changes it's label -> OK
the label gets focused -> OK
(sometimes - style is flickering for a fraction of a second)
the button receives the focus after a short time "stealing" the focus from the label
Expected Result
the label remains focused
when pressing the second button "no autodisable' or 'no label change'
Debug Information
this happens when the button has both autodisable enabled and a changing label at the same time
Workaround
when focusing native dom elements directly zk.currentFocus needs to be cleared.
(not necessary when using client side Widget.focus(), or server side focusing)
<button label="with autodisable" autodisable="self" xmlns:w="client"> <attribute name="onClick"><![CDATA[ self.setLabel("updated label" + new Date()); ]]></attribute> <attribute w:name="onClick"><![CDATA[ // shall clear zk.currentFocus to prevent focus restore to the auto disabled button zk.currentFocus = null; zk.$('$title').$n().focus(); ]]></attribute> </button>