Giter Site home page Giter Site logo

Comments (9)

icecoldfire avatar icecoldfire commented on June 25, 2024

Dear

I don't understand the issue could you please make a minimal reproducible example using stackblitz.com?

What is the behaviour you expect?

from ng-select2.

afeef1915 avatar afeef1915 commented on June 25, 2024

I need when we search in textbox .

After search we bind data in [data]=[select2data].

	changed(search: any) {

				   //call service pass search text to service
					return this.cl.searchFunc(search).subscribe(
					  res1 => 
							  this.select2data = res1.data;
							  this.cd.markForCheck(); // marks path
							 this.cd.detectChanges();
						  }
						}
					  },
					  error => {
						console.log('error  = ', error);
					  });
				  }

Problem

After Response Dropdown Html.

   <span class="select2-container select2-container--default select2-container--open" style="position: absolute; top: 255px; left: 823.484px;">

Dropdown hides after search. its visible after click on textbox.

but on click on textbox dropdown visible : fine
but after search : dropdown hides after appending response

Issue in code

debugger halts

d.prototype._registerSelectionEvents = function() {
var n = this
, r = ["toggle", "focus"];
this.selection.on("toggle", function() {
n.toggleDropdown()
}),
this.selection.on("focus", function(e) {
n.focus(e)
}),
this.selection.on("*", function(e, t) {
-1 === i.inArray(e, r) && n.trigger(e, t)
})
}
,

its problem in toggling function

from ng-select2.

icecoldfire avatar icecoldfire commented on June 25, 2024

I'm not finding the link to minimal reproducible example using stackblitz.com, could you please share this link with me?

from ng-select2.

afeef1915 avatar afeef1915 commented on June 25, 2024

you try same code with Angular

try with subscribe and save response [data]="select2data "
<ng-select2
[data]="select2data "
[options]="options"
[width]="500"
[formControlName]="field.code"
(keyup)="changed($event.target.value)"

			changed(search: any) {

			//call service pass search text to service
					return this.cl.searchFunc(search).subscribe(
					res1 => 
					  this.select2data = res1.data;
					  this.cd.markForCheck(); // marks path
					 this.cd.detectChanges();
					}
					}
					},
					error => {
					console.log('error  = ', error);
					});
			}

The way subscribe works.

Problem is after saving subscribe response

for example sample data

this.select2data = [
{
id: 'multiple1',
text: 'Multiple 1'
},
{
id: 'multiple2',
text: 'Multiple 2'
},
{
id: 'multiple3',
text: 'Multiple 3'
},
{
id: 'multiple4',
text: 'Multiple 4'
}
];

After subscribe response dropdown hides.

dropdown only visible after you click on textbox that's bug.

Thanks

from ng-select2.

icecoldfire avatar icecoldfire commented on June 25, 2024

Thank you for the further explaining of the issue. Could you please give me the link to minimal reproducible example using stackblitz.com?

from ng-select2.

afeef1915 avatar afeef1915 commented on June 25, 2024

stackblitz

https://stackblitz.com/edit/angular-dtcqnc

ERROR
Error: jQuery is not defined

from ng-select2.

icecoldfire avatar icecoldfire commented on June 25, 2024

Thank you for the link.

Error: jQuery is not defined

This issue comes from that you include jquery using angular.json. See: stackblitz/core#407

afbeelding

I have build the project locally and everything works fine. Because there is no issue in your project I'm going to close the issue for now.

Keep me updated when the issue persists.

from ng-select2.

afeef1915 avatar afeef1915 commented on June 25, 2024

Your project doesn't have stackblitz demo.

as you said it will not work on stackblitz.

why can't you try to build a demo using Angular 8 on stackblitz.

can you please try with my code above .

by subscribing you replicate error.

				<ng-select2
				[data]="select2data "
				[options]="options"
				[width]="500"
				[formControlName]="field.code"
				(keyup)="changed($event.target.value)">

				typescript code

				changed(search: any) {

				//call service pass search text to service
				return this.cl.searchFunc(search).subscribe(
				res1 => 
				this.select2data = [
				{
				id: 'multiple1',
				text: 'Multiple 1'
				},
				{
				id: 'multiple2',
				text: 'Multiple 2'
				},
				{
				id: 'multiple3',
				text: 'Multiple 3'
				},
				{
				id: 'multiple4',
				text: 'Multiple 4'
				}
				];
				}
				}
				},
				error => {
				console.log('error  = ', error);
				});
				}

from ng-select2.

icecoldfire avatar icecoldfire commented on June 25, 2024

Your project doesn't have stackblitz demo.
as you said it will not work on stackblitz.
sorry to say your plugin is most pathetic i have found on google and support is even worse.
i wouldn't recommend to anyone

Sorry to hear that you don't like this open source project and the volunteer support of the maintainers. Please fork us so that you can make this project even better!

Keep us posted with the progress you make so that we can push it upstream.

from ng-select2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.