myplanet / angular-deep-blur Goto Github PK
View Code? Open in Web Editor NEWChild-aware blur handler for Angular
Home Page: http://myplanet.github.io/angular-deep-blur/
License: MIT License
Child-aware blur handler for Angular
Home Page: http://myplanet.github.io/angular-deep-blur/
License: MIT License
The module definition looks like this:
if (typeof define === 'function' && define.amd) {
define([ 'module', 'angular' ], function (module, angular) {
module.exports = factory(angular);
});
} else if (typeof module === 'object') {
module.exports = factory(require('angular'));
} else {
if (!root.mp) {
root.mp = {};
}
root.mp.deepBlur = factory(root.angular);
}
Electron, but not Chrome, satisfies the "typeof module === 'object'" condition, but cannot then find the angular module.
Here is an example of a module definition that does not break Electron, from angular-cache, which uses webpackUniversalModuleDefinition():
if(typeof exports === 'object' && typeof module === 'object')
module.exports = factory(require("angular"));
else if(typeof define === 'function' && define.amd)
define("angular-cache", ["angular"], factory);
else if(typeof exports === 'object')
exports["angularCacheModuleName"] = factory(require("angular"));
else
root["angularCacheModuleName"] = factory(root["angular"]);
}
In the second case, Electron drops down to the last "else" block; forcing deep-blur to do the same fixes the error. Further than that, I can't really say. But I am having to patch around this.
Would it be possible to include the license info as a comment in the top of the file? Would make it easier to stay in compliance with the MIT license when running the script through concat/minify.
if child element have ng-hide, the blur event is triggered after the hide, which make the activeElement capture body node.
here is the demo of problem:
https://jsfiddle.net/harryfeng514/k6jqwzvm/
I think in touch devices the blur is not working because are different types of clicks (click and touch).
I am telling this because I tested in PC browser and it worked well but in Android Chrome browser it dind't worked.
I tested with the example page and setted the device type in the Chrome tools to mobile and it worked but in what I did doesn't work the click outside and close in my case the search bar.
If someone need more information I can give.
I tried the demo using IE 11 and the selection in the dropdown just hides [not selected] when clicked or focused on.
version 1.0.9, explicitOriginalTarget missing on blur event.
https://jsfiddle.net/jama5/kpwchbzo/
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.