Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
605
IgxAutocompleteDirective throws exception when Edge form filler is used
posted

We have a control using IgxAutocompleteDirective on a form with other text fields.

When the user selects a form filler field for one of the other text fields, auto-complete throws an exception in this method

handleKeyDown(event) {
    if (!this.collapsed && !this._composing) {
        switch (event.key.toLowerCase()) {

because event.key is not defined.

This is causing significant issues in our application and requires us to try to inform our users not to use form filling.

Parents
  • 460
    Offline posted

    Hello,

    Thank you for bringing this describe behavior to our attention. From your description, it seems the exception is occurring because event.key is undefined when a form filler is used with the IgxAutocompleteDirective. This behavior can happen if the form filler triggers events that don't follow the typical keyboard event pattern, leading to the error when the method attempts to use event.key.toLowerCase().

    To address this, one approach would be to modify the handleKeyDown method to ensure that it checks for the existence of event.key before trying to access it. Here’s an example of how this could be handled:

    handleKeyDown(event) {
        if (!this.collapsed && !this._composing) {
            // Safeguard to check if event.key is defined before accessing it
            if (event.key) {
                switch (event.key.toLowerCase()) {
                    // Handle different key cases here
                }
            }
        }
    }

    By adding this safeguard, we can prevent the application from throwing an exception when the form filler interacts with the IgxAutocompleteDirective.

    If this not helped, to better understand and investigate the describe behavior in your specific context, could you please provide the following:

    • A more detailed explanation of how and when the describe behavior occurs in your application.
    • Any relevant code snippets where the autocomplete control is being used, especially in relation to form fillers.
    • Screenshots or video recordings showing the issue, if available.

    Additionally, the best approach would be to provide an isolated sample that reproduces the scenario, along with step-by-step instructions. This will allow us to thoroughly examine the behavior and work towards a more robust solution.

    We look forward to receiving more information to assist you further and provide a targeted fix.

    Regards,

    Georgi Anastasov

    Entry Level Software Developer

    Infragistics

Reply Children