Comments (9)
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.
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.
I'm not finding the link to minimal reproducible example using stackblitz.com, could you please share this link with me?
from ng-select2.
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.
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.
stackblitz
https://stackblitz.com/edit/angular-dtcqnc
ERROR
Error: jQuery is not defined
from ng-select2.
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
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.
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.
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)
- Wrong value shown when using "tags" option with initial value of null HOT 6
- Is there async support for this wrapper? HOT 1
- How to trigger change event with server side select2 to download and render a selected item? HOT 1
- No valueChanged Update with Browser Autocomplete HOT 3
- Unable to set default/starting value HOT 2
- Is it possible to remove default title attribute for selected items? HOT 1
- Create event for blur or focus out HOT 1
- Change the touched attribute to reflect on blur HOT 1
- NG0100: Expression has changed after it was checked HOT 1
- How to change options for ng-select2 that's already initialized? HOT 1
- Trying to install with NPMv7 gives error for incorrect peer dependency HOT 1
- ng build failed ng-select2 version 1.2.7 HOT 1
- Error: The target entry-point "ng-select2" has missing dependencies: - Select2 HOT 5
- When click on clear button, Open drop down again HOT 1
- 2 issues on drop down list HOT 1
- No valueChanged Update with Browser Autocomplete HOT 2
- ng-select2 with Reactive Forms HOT 2
- how I can bind reactive form formControlName in ng-select2 directive HOT 1
- Need to add custom class HOT 1
- Error: The target entry-point "ng-select2" has missing dependencies: - Select2 HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ng-select2.