calling the function before overridden in typescript produces a compiler error

XMLWordPrintable

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Normal
    • None
    • Affects Version/s: 10.0.0.FL
    • Component/s: None
    • 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

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

              Created:
              Updated: