angular-ui / bootstrap

PLEASE READ THE PROJECT STATUS BELOW. Native AngularJS (Angular) directives for Bootstrap. Smaller footprint (20kB gzipped), no 3rd party JS dependencies (jQuery, bootstrap JS) required. Please read the README.md file before submitting an issue!
http://angular-ui.github.io/bootstrap/
MIT License
14.3k stars 6.74k forks source link

feat(tooltip): Prevent close tooltip with 'esc' key #6626

Open RDD2017 opened 6 years ago

RDD2017 commented 6 years ago

Motivation

Tooltip must be shown if \<input> tag isn't valid, but if user press 'ESC' key it closes tooltip and reset validation.

This PR introduce new option 'tooltip-enable-esc'.

If user set 'tooltip-enable-esc' as false, tooltip will not closed.

By default 'tooltip-enable-esc' is true.

How to use

        <input type="text"
               ng-model="amount"
               numbers-only
               tooltip-enable-esc="false"
               uib-tooltip="Amount field must be number"
               tooltip-enable="error"
               tooltip-is-open="error"
               tooltip-trigger="'none'"
               tooltip-placement="bottom" />