Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ng-select Dropdown is slightly off on modals #452

Closed
Fagiolia1 opened this issue Feb 5, 2020 · 14 comments · Fixed by #471
Closed

[BUG] ng-select Dropdown is slightly off on modals #452

Fagiolia1 opened this issue Feb 5, 2020 · 14 comments · Fixed by #471
Assignees
Labels
bug Something isn't working in progress Work on this issue is in progress

Comments

@Fagiolia1
Copy link

Describe the bug
When a select is being used within a modal, the dropdown menu underneath the input is slightly off to left.

To Reproduce
Steps to reproduce the behavior:

  1. Go to a modal with an ng-select element.
  2. Click on select box.
  3. See error

Expected behavior
The dropdown menu should be directly below the input.

Screenshots
image

@Fagiolia1 Fagiolia1 added bug Something isn't working new issue This issue has yet to receive attention labels Feb 5, 2020
@grahamhency grahamhency self-assigned this Feb 5, 2020
@eligolding
Copy link
Contributor

This issue is related to the need to add appendTo="body". It was reported in ng-select, and the supposed solution is to make sure you set position: relative on the body. I tried that and it still did not work.

You can see my comment here that we might not need appendTo after all, so this issue will go away.

@grahamhency grahamhency added in progress Work on this issue is in progress and removed new issue This issue has yet to receive attention labels Feb 12, 2020
This was referenced Feb 12, 2020
@grahamhency
Copy link
Contributor

grahamhency commented Feb 13, 2020

Closed with #471

@IoSono000
Copy link

Hi, i continue to have the same problem. If I insert the component in a simple html page no problem, but if I insert it in a more complex context, the problem remains ...

@grahamhency
Copy link
Contributor

@IoSono000 can you provide an example? What version of Goponents are you running?

@IoSono000
Copy link

IoSono000 commented Mar 30, 2020

@IoSono000 can you provide an example? What version of Goponents are you running?

Hi, the version is last (3.7.3).

--- OK --

  <form aria-labelledby="dati-ispezione" [formGroup]="intermediarioSrcForm" class="form-horizontal mt-3" novalidate>

    <div class="row">
      
      <div class="col-md-12">
        <div class="form-group">

          <label for="tipologia" translate>HOME.SEARCH_ADV.LBL_TIPOLOGIA</label>
		
		  <!-- KO -->
          <ng-select 
            appendTo="body"
            class="ng-select-custom-big" 
            labelForId="tipologia" 
            [items]="profiliRischio"
            [multiple]="true"
            [hideSelected]="true"
            [closeOnSelect]="false"
            formControlName="tipologia">
          </ng-select>
        </div>
      </div>

    </div>

  </form>
  
</div>

@grahamhency
Copy link
Contributor

@IoSono000 that is not using the go-select. If you're looking for the documentation on ng-select you'll want to check https://github.com/ng-select/ng-select

@IoSono000
Copy link

@IoSono000 that is not using the go-select. If you're looking for the documentation on ng-select you'll want to check https://github.com/ng-select/ng-select

sorry but your note is not clear. The implementation was done as per documentation.

@grahamhency
Copy link
Contributor

@IoSono000 this repo is not the ng-select project. We implement the ng-select component in this project for our go-select. If you're trying to troubleshoot an issue with ng-select then you'll need to look at their documentation.

If you are trying to use our Goponents library then you need to be using go-select here.

@IoSono000
Copy link

@IoSono000 this repo is not the ng-select project. We implement the ng-select component in this project for our go-select. If you're trying to troubleshoot an issue with ng-select then you'll need to look at their documentation.

If you are trying to use our Goponents library then you need to be using go-select here.

Ok, thanks and sorry

@renanramos
Copy link

Hi @IoSono000
Have you found a solution for that? I've looking for a way to handle but unfortunately, I didn't find anything yet :/

@grahamhency
Copy link
Contributor

@renanramos this is not the ng-select repo so this issue probably doesn't apply to you. However, we implemented a solution through CSS. It is messy, but it works for us.

// overrides incorrect alignment when appendTo body is applied to an ng-select
body > .ng-dropdown-panel {
  margin-left: 4px;
}

@IoSono000
Copy link

@renanramos this is not the ng-select repo so this issue probably doesn't apply to you. However, we implemented a solution through CSS. It is messy, but it works for us.

// overrides incorrect alignment when appendTo body is applied to an ng-select
body > .ng-dropdown-panel {
  margin-left: 4px;
}

Thanks, i added the following statement to the scss file
:: ng-deep ng-dropdown-panel {
   margin-left: 9px;
}

the problem is that if I resize the page that left margin is no longer good and it is misaligned again ... have you done this test?

@grahamhency
Copy link
Contributor

@IoSono000 we have not handled that case yet.

@renanramos
Copy link

@grahamhency Thanks!
I'll use this approach in my case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working in progress Work on this issue is in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants