-
-
Notifications
You must be signed in to change notification settings - Fork 902
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
issues if usage of [isOpen] with variable #816
Comments
|
ok thx. So does this then mean, if I use [isOpen] than there is no way to get the behavior like its not used? Is this a bug? Is this a feature? |
I think this could be improvement to act as usual if value is not true or false |
* remotes/main/master: (25 commits) chore(release): 2.13.3 fix: keep selected items while bindValue is incorrect closes ng-select#993 chore(release): 2.13.2 fix: appended dropdown position (ng-select#957) chore(release): 2.13.1 fix: map selected items while source changed closes ng-select#980, ng-select#977, ng-select#959 chore(release): 2.13.0 [fix] - $event.path does not work in Safari and Firefox. Replace with $event.composedPath(). (ng-select#968) feat(templates): add searchTerm to header and footer (ng-select#961) chore(release): 2.12.1 chore: include scss with package closes ng-select#909 fix: use classList instead of className closes ng-select#940 add aria-selected attribute on selected items (ng-select#936) fix: handler mousedown for clear event when used animation library (ng-select#931) chore(release): 2.12.0 feat(autofocus): focus if attribute is present (ng-select#924) feat(isOpen): treat undefined value as default behaviour closes ng-select#816 feat: allow to customise clear icon fixes ng-select#835 chore(demo): fix virtual scroll example closes ng-select#921 fix: keep items order while mapping selected options fixes ng-select#907 ...
The ngChanges which sets manually open seems to run after the dialog has already been closed by an outside click. The original intent of this feature was to make is so that an outside click would not close the select. For example, using a material overlay component inside the template of ng-select will cause the overlay to be rendered outside of the select and thus trigger the dialog to be closed. I think that a solution might be to allow some elementRefs or selectors to be passed which will be ignored by the outside click directive. Or, delay the call to close() until after changeDetection has run. Calling close() on outsideClick will happen before the props are updated. |
Current behavior is useless. |
Describe the bug
If you use the [isOpen] functionality for ng-select with a variable its somehow not possible to get in Defaultmode (as it is if you NOT use [isOpen])
To Reproduce
Steps to reproduce the behavior:
Use see the implementation like
if the
myOpenVar
is true/false everything works as expected. withtrue
the searchlayer is (always) open, iffalse
the searchlayer never opens. But if you use the "default"-value "-" like its mentioned here (https://github.com/ng-select/ng-select#api) the behavior is like [isOpen]=trueExpected behavior
Consider a situation where you want fill all the options dynamically by a configuration. Maybe the normal/default implementation should be an ng-select behavior without the [isOpen] functionality. But e.g
false
ortrue
should be an option.If [isOpen] is not provided in the config, then
myOpenVar
should get a value that ng-select behaves like [isOpen] is not provided, that means "open layer onclick" and "close layer on select":summary
So it should be possible to get all 3 states for ng-select (isOpen true, isOpen false, isOpen default) by providing via variable.
Desktop (please complete the following information):
newest Chrome
angular6 and ng-select 2.9.0
The text was updated successfully, but these errors were encountered: