I am trying to display an AngularStrap dropdown manually, leveraging the trigger
configuration on $dropdownProvider
as such
// how dropdown is triggered - click | hover | focus | manual
app.config(function($dropdownProvider) {
angular.extend($dropdownProvider.defaults, {
trigger: 'manual'
});
});
click
hover
focus
all work fine, but why not manual
? I have yet to discover any proof that this offered api configuration option works. How can I do this?
In fact, this issue seems to have been discovered after my original question positing, but is now closed and over a year later I have yet to find a solution still.
Issue: Documentation on how to use trigger=manual is missing
I have stubbed out an example that illustrates where I am struggling with this. To clarify my goal, I want to trigger the dropdown in my <textarea>
on a keystroke (ng-model
change). I am looking to get a hold on the dropdown and call a function to manually trigger it without using any of the default trigger options, specifically trigger: manual
, and in an intuitive way to do so as should be offered according to the api, so the desired solution should not be constrained to any specific trigger - but entirely manual to accommodate many differing usages.
<textarea ng-model="expression" intellisense></textarea>
app.directive('intellisense', [function () {
return {
restrict: 'A',
link: function (scope, elem, attrs) {
scope.$watch(attrs.ngModel, function (v) {
if(v) {
// how do I trigger dropdown here on keystroke (model change)?
}
});
}
}
}]);