JavaScript UI Libraries & Blazor Components Suite – Smart UI Forums Text Boxes & Inputs Bug (regression) in smart-input keyup handler

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #109988
    m-akinc
    Participant

    I have run into an issue in the smart-query-builder when upgrading from version 15 to 16. We configure a query field with a lookup.dataSource that is a function. Though I don’t see documentation that says it can be a function (docs just say it should be an array), this has been supported, and there is still logic that handles this*. However, there has been new logic added to _keyupHandler() that breaks when dataSource is a function:
    if (t.dataSource && t.dataSource.length) { // if t.dataSource is a function, length is the number of parameters
     for (let e = 0; e < t.dataSource.length; e++) {
      const o = t.dataSource[e]; // can't index a function, so o is undefined
      if ("string" == typeof o) {
       ...
      } else if (void 0 !== o.label && o.label === t.$.input.value) { // error here trying to access label on undefined!
       ...
      }
     }
    }

    *E.g. the open() function contains: "function" == typeof e.dataSource ? e.dataSource(e.query, t) : t(e.dataSource)
    As I describe in the source comments, when dataSource is a function, the length property is the number of parameters, but then the code tries to index into it like an array. The resulting error prevents the control from working correctly.

    #109989
    ivanpeevski
    Participant

    Hi,

     

    Thank you for the feedback! I have opened a work item for that and we will resolve it for our next release.

     

    Best Regards,
    Ivan Peevski
    Smart UI Team
    https://www.htmlelements.com/

    #109990
    m-akinc
    Participant

    Thank you. Can we also get a patch release for version 16?

    #109991
    Markov
    Keymaster

    Hi,

    We usually add the bug fixes & new features only in the new versions.

    Best Regards,
    Markov

    Smart UI Team
    https://www.htmlelements.com/

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.