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

tri-state checkmark still checks while disable when clicking in the border


    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Normal Normal
    • 9.6.0
    • 9.5.1
    • Components
    • Security Level: Jimmy

      Steps to Reproduce


      Click inside the red square, but outside the checkmark for the 1st and 2nd checkmarks (3 and 4 are regular checkmarks)

      these checkboxes are disabled.

      Current Result

      checkbox state is updated

      Expected Result

      checkbox state is not updated

      Debug Information

      There is on disabled check in the checbox doClick.

      Regular checkbox have 2 workflows:

      • If click on disabled html checkmark: no event due to disabled dom element not firing event
      • if click inside the border of the checkbox component, but outside the html checkmark, the doClick_ method will fire and check if dom checked status == current checked status. If yes, it returns and does not update.

      On tri-state checkbox:

      doClick_ (from dom checkmark, or from outer checkbox span) directly trigger changeState. disabled dom checkmark doesn't fire events, but the outer checkbox span will still resolve to the doClick_ method.


      Add a disable check:

      		zk.afterLoad("zul.wgt", function () {
      		    var _xCheckbox = {};
      		    zk.override(zul.wgt.Checkbox.prototype, _xCheckbox, {
      		        doClick_: function() {
      					var result = _xCheckbox.doClick_.apply(this, arguments);
      					return result;

            Leon03 Leon03
            MDuchemin MDuchemin
            0 Vote for this issue
            3 Start watching this issue