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

calling the function before overridden in typescript produces a compiler error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • None
    • 10.0.0.FL
    • None

      Steps to Reproduce

      a typescript that override a widget's doKeyDown_()

      zk.afterLoad('za11y, zkmax.layout', function() {
          const exWidget = zk.augment(zkmax.layout.Portallayout.prototype, {
              doKeyDown_: function () {
                  // to skip the function in za11y, call its parent's parent's method
                  exWidget.doKeyDown_.apply(arguments);
              },
          });
      });
      

      Current Result

      widgetCustomization/portallayout-disable-nav.ts:9:22 - error TS2339: Property 'doKeyDown_' does not exist on type 'Pick<Widget<any>, never>'.
      
      9             exWidget.doKeyDown_.apply(arguments);
                             ~~~~~~~~~~
      

      Expected Result

      no error

      Debug info

      • it's better to declare all default event handler function names: do[EVENT_NAME]_() in zk-types

            Unassigned Unassigned
            hawk hawk
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: