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
530
Problem with Igx-Combo
posted

Hi,

Hello,
I have a problem when I want to use Igx-Combo on Igx-Tab which is itself on Igx-Dialog.
I get an error message when I want to close the combo in this method

public singleSelectionTask(event: IComboSelectionChangingEventArgs) {
  if (event.added.length) {
    event.newSelection = event.added;
  }
  this.combolistetache.close();
}
HTML CODE : 

ERROR MSG : 

When I position Igx-Combo outside Igx-Tab, I have no problem.

Thanks for your help.

Best regards,

Philippe DUFEIL

Parents
  • 620
    Verified Answer
    Offline posted

    Hello Philippe,

    Thank you for posting into our community!

    I have been looking into your question, however, on my side, I was not able to reproduce this behavior and the combo is closed without any errors in the DevTools Console.

    Having this in mind, could you please provide a small working sample that demonstrates the behavior on your side?

    Additionally, it is recommended to use the IgxSimpleCombo instead of modifying the IgxCombo with the following code:

    public singleSelectionTask(event: IComboSelectionChangingEventArgs) {
        if (event.added.length) {
            event.newSelection = event.added;
        }
        this.combolistetache.close();
    }

    However, if you would like to use the IgxCombo instead, what I could suggest, in order to close the combo after selecting/deselecting an item, is using the owner argument which provides a reference to the owner component, i.e., the IgxCombo.

    public singleSelectionTask(event: IComboSelectionChangingEventArgs) {
        ...
        event.owner.close();
    }

    Please test this approach on your side and let me know how it behaves.

    Looking forward to your reply.

    Sincerely,
    Riva Ivanova
    Associate Software Developer

Reply Children
No Data