Uploaded image for project: 'ZK'
  1. ZK
  2. ZK-2739

Modal window didn't focus on previously focused button when button have autodisabled setted

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 7.0.6
    • 7.0.5
    • Components
    • Security Level: Jimmy
    • None
    • ZK 7.0.7

      The autodisabled button didn't gain focus again when close other modal window.
      This issue only happens on Chrome.
      Reproducible sample:

      index.zul
      <zk>
      	<window border="normal" title="Test" height="210px"
      		contentStyle="overflow-y:scroll;" mode="modal">
      		<vlayout spacing="10px">
      			<textbox />
      			<label value="This example is to demonstrate one error in focus, when one modal is showed." />
      			<label value="When user clicks in one of the buttons in the end of the page, one new modal is created." />
      			<label value="Is expected that when the new modal is detached, the focus must return to the last element focused in the previous popup." />
      			<label value="This behavior doesn't verify when button has the autodisabled property setted to 'self', because on detach of the new modal, the focus is placed in the first input element of the modal." />
      			<label value="This problem don't happen using internet explorer." />
      			<hlayout>
      				<textbox />
      				<button label="Open Modal button without autodisabled"
      					onClick='Executions.createComponents("modal.zul", null, null)' />
      			</hlayout>
      			<hlayout>
      				<textbox />
      				<button label="Open Modal button with autodisabled"
      					onClick='Executions.createComponents("modal.zul", null, null)' autodisable="self" />
      			</hlayout>
      		</vlayout>
      	</window>
      </zk>
      
      modal.zul
      <zk>
      	<window id="modal" border="normal" title="Test Modal Detach" mode="modal">
      		Click to close the modal, and check the focus behavior.
      		<button id="btn" label="Close" onClick="modal.detach()" />
      	</window>
      </zk>
      

            DevChu DevChu
            vincentjian vincentjian
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 hours
                4h