Autocomplete issue into bootstrap modal

前端 未结 11 2515
旧时难觅i
旧时难觅i 2020-12-01 05:57

I have a display problem in the jQuery autocomplete inside a modal dialog bootstrap.

When I mouse scroll, the results do not remain attached to the input.

Is

相关标签:
11条回答
  • 2020-12-01 06:39

    Adding the appendTo option resolved this issue. It appended the menu to one of the objects in the bootstrap model.

    0 讨论(0)
  • 2020-12-01 06:41

    To fix this I just needed to alter in the css file by jQuery:

    .ui-front {
        z-index: 9999;
    }
    

    Note: Add this css after jquery-ui.css & jquery-ui.js

    0 讨论(0)
  • 2020-12-01 06:48

    In file: styles.css

    .cdk-overlay-container
    {
        z-index: 9999 !important;
    }
    

    I tried all solutions in my internal css file of the component, and nothing works, only when moved it to styles.css.

    good luck

    0 讨论(0)
  • 2020-12-01 06:49

    With add the class "ui-front" to the div parent element and the autocomplete will be correctly displayed inside the PopUp For Me.

    0 讨论(0)
  • 2020-12-01 06:52

    Check out the appendTo documentation:

    When the value is null, the parents of the input field will be checked for a class of ui-front. If an element with the ui-front class is found, the menu will be appended to that element.

    So just add the class "ui-front" to the parent element and the autocomplete will be correctly displayed inside the modal.

    0 讨论(0)
提交回复
热议问题