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

Add appendTo input to go-select #260

Merged
merged 5 commits into from
Oct 14, 2019

Conversation

jaredami
Copy link
Contributor

@jaredami jaredami commented Oct 8, 2019

Closes #246

Currently, making a selection on a go-select within a go-modal causes the modal to close. Sometimes we might desire that the go-modal remain open until a submission button is clicked, for instance.

By adding an appendTo input to our go-select and passing it to the appendTo input of the contained ng-select, we can make it so that a go-modal will remain open upon making a selection to a go-select within it using appendTo="'body'".

Example:

openModal(): void {
    this.goModalService.openModal(
      GoSelectComponent,
      {
        appendTo: 'body',
        bindLabel: 'name',
        bindValue: 'value',
        control: this.select10,
        items: this.items,
        label: 'Favorite Candy',
      }
    );
  }

@jaredami jaredami added the chore General chore or maintenance task label Oct 8, 2019
@grahamhency grahamhency changed the base branch from master to v1.3.0 October 9, 2019 13:47
@grahamhency grahamhency added this to the v1.3.0 milestone Oct 9, 2019
@jaredami jaredami force-pushed the chore_add_appendto_input_to_go_select branch from 0c87706 to cfd44d1 Compare October 9, 2019 15:00
@jaredami jaredami assigned StevenUlmer and unassigned StevenUlmer Oct 9, 2019
@jaredami jaredami requested review from grahamhency and removed request for StevenUlmer October 9, 2019 20:10
Copy link
Contributor

@grahamhency grahamhency left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jaredami just a comment on this one, looks pretty good so far.

@jaredami jaredami requested a review from grahamhency October 14, 2019 15:34
@jaredami jaredami merged commit dcf5a27 into v1.3.0 Oct 14, 2019
@jaredami jaredami deleted the chore_add_appendto_input_to_go_select branch October 14, 2019 19:47
@grahamhency grahamhency mentioned this pull request Oct 23, 2019
@eligolding
Copy link
Contributor

@jaredami Sorry for commenting on something so old, but just wanted to bring up that this solution introduces other issues. I am experiencing both of these issues that others have had with ng-select: ng-select/ng-select#1130 and ng-select/ng-select#929. The real solution will need to involve fixing the modal not to close, which @patryk0605 may have fixed here: #410

@jaredami
Copy link
Contributor Author

@eligolding Gotcha. Thanks for filling me in 👍

@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 ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
chore General chore or maintenance task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants