diff --git a/java/src/main/java/com/vaadin/elements/grid/ViolatedGrid.java b/java/src/main/java/com/vaadin/elements/grid/ViolatedGrid.java index 88f9ae163..4459ba07d 100644 --- a/java/src/main/java/com/vaadin/elements/grid/ViolatedGrid.java +++ b/java/src/main/java/com/vaadin/elements/grid/ViolatedGrid.java @@ -161,11 +161,24 @@ public void onBrowserEvent(Event event) { focusGridIfSelectAllClicked(event); Element targetElement = (Element)event.getEventTarget().cast(); - if (targetElement != WidgetUtil.getFocusedElement() || isElementOutsideStaticSection(targetElement)) { + + // by default Grid steals focus from focusable elements inside cells, + // so we need to prevent that. + Element focusedElement = WidgetUtil.getFocusedElement(); + if (elementContains(targetElement, focusedElement)) { + return; + } + + if (targetElement != focusedElement || isElementOutsideStaticSection(targetElement)) { super.onBrowserEvent(event); } } + private native Boolean elementContains(Element parent, Element child) + /*-{ + return parent.contains(child); + }-*/; + private boolean isElementOutsideStaticSection(Element element) { TableSectionElement headerElement = getEscalator().getHeader().getElement(); TableSectionElement footerElement = getEscalator().getFooter().getElement(); diff --git a/vaadin-grid.min.js b/vaadin-grid.min.js index 0c3c7b392..6ee61f6c3 100644 --- a/vaadin-grid.min.js +++ b/vaadin-grid.min.js @@ -1,11 +1,11 @@ -function VaadinGridImport(){var ub='',vb=0,wb='gwt.codesvr=',xb='gwt.hosted=',yb='gwt.hybrid',zb='VaadinGridImport',Ab='meta',Bb='name',Cb='gwt:property',Db='content',Eb='=',Fb=1,Gb='gwt:onPropertyErrorFn',Hb='Bad handler "',Ib='" for "gwt:onPropertyErrorFn"',Jb='gwt:onLoadErrorFn',Kb='" for "gwt:onLoadErrorFn"',Lb='user.agent',Mb='webkit',Nb='safari',Ob='msie',Pb=10,Qb=11,Rb='ie10',Sb=9,Tb='ie9',Ub=8,Vb='ie8',Wb='gecko',Xb='gecko1_8',Yb=2,Zb=3,$b=4,_b='Single-script hosted mode not yet implemented. See issue ',ac='http://code.google.com/p/google-web-toolkit/issues/detail?id=2079',bc='80368953095460DCF46286A6CF647E05',cc=':1',dc=':',ec='DOMContentLoaded',fc=50;var j=ub,k=vb,l=wb,m=xb,n=yb,o=zb,p=Ab,q=Bb,r=Cb,s=Db,t=Eb,u=Fb,v=Gb,w=Hb,A=Ib,B=Jb,C=Kb,D=Lb,F=Mb,G=Nb,H=Ob,I=Pb,J=Qb,K=Rb,L=Sb,M=Tb,N=Ub,O=Vb,P=Wb,Q=Xb,R=Yb,S=Zb,T=$b,U=_b,V=ac,W=bc,X=cc,Y=dc,Z=ec,$=fc;var _=window,ab=document,bb,cb,db=j,eb={},fb=[],gb=[],hb=[],ib=k,jb,kb;if(!_.__gwt_stylesLoaded){_.__gwt_stylesLoaded={}}if(!_.__gwt_scriptsLoaded){_.__gwt_scriptsLoaded={}}function lb(){var b=false;try{var c=_.location.search;return (c.indexOf(l)!=-1||(c.indexOf(m)!=-1||_.external&&_.external.gwtOnLoad))&&c.indexOf(n)==-1}catch(a){}lb=function(){return b};return b} +function VaadinGridImport(){var ub='',vb=0,wb='gwt.codesvr=',xb='gwt.hosted=',yb='gwt.hybrid',zb='VaadinGridImport',Ab='meta',Bb='name',Cb='gwt:property',Db='content',Eb='=',Fb=1,Gb='gwt:onPropertyErrorFn',Hb='Bad handler "',Ib='" for "gwt:onPropertyErrorFn"',Jb='gwt:onLoadErrorFn',Kb='" for "gwt:onLoadErrorFn"',Lb='user.agent',Mb='webkit',Nb='safari',Ob='msie',Pb=10,Qb=11,Rb='ie10',Sb=9,Tb='ie9',Ub=8,Vb='ie8',Wb='gecko',Xb='gecko1_8',Yb=2,Zb=3,$b=4,_b='Single-script hosted mode not yet implemented. See issue ',ac='http://code.google.com/p/google-web-toolkit/issues/detail?id=2079',bc='B54CB3CECD7AAD680262E49C2BA25FAF',cc=':1',dc=':',ec='DOMContentLoaded',fc=50;var j=ub,k=vb,l=wb,m=xb,n=yb,o=zb,p=Ab,q=Bb,r=Cb,s=Db,t=Eb,u=Fb,v=Gb,w=Hb,A=Ib,B=Jb,C=Kb,D=Lb,F=Mb,G=Nb,H=Ob,I=Pb,J=Qb,K=Rb,L=Sb,M=Tb,N=Ub,O=Vb,P=Wb,Q=Xb,R=Yb,S=Zb,T=$b,U=_b,V=ac,W=bc,X=cc,Y=dc,Z=ec,$=fc;var _=window,ab=document,bb,cb,db=j,eb={},fb=[],gb=[],hb=[],ib=k,jb,kb;if(!_.__gwt_stylesLoaded){_.__gwt_stylesLoaded={}}if(!_.__gwt_scriptsLoaded){_.__gwt_scriptsLoaded={}}function lb(){var b=false;try{var c=_.location.search;return (c.indexOf(l)!=-1||(c.indexOf(m)!=-1||_.external&&_.external.gwtOnLoad))&&c.indexOf(n)==-1}catch(a){}lb=function(){return b};return b} function mb(){if(bb&&cb){bb(jb,o,db,ib)}} function nb(){var b=document.getElementsByTagName(p);for(var c=k,d=b.length;c=k){f=g.substring(k,i);h=g.substring(i+u)}else{f=g;h=j}eb[f]=h}}else if(f==v){g=e.getAttribute(s);if(g){try{kb=eval(g)}catch(a){alert(w+g+A)}}}else if(f==B){g=e.getAttribute(s);if(g){try{jb=eval(g)}catch(a){alert(w+g+C)}}}}}} __gwt_isKnownPropertyValue=function(a,b){return b in fb[a]};__gwt_getMetaProperty=function(a){var b=eb[a];return b==null?null:b};function ob(a,b){var c=hb;for(var d=k,e=a.length-u;d=I&&b=L&&b=N&&b=J}())return Q;return j};fb[D]={'gecko1_8':k,'ie10':u,'ie8':R,'ie9':S,'safari':T};VaadinGridImport.onScriptLoad=function(a){VaadinGridImport=null;bb=a;mb()};if(lb()){alert(U+V);return}nb();try{var qb;ob([Q],W);ob([G],W+X);qb=hb[pb(D)];var rb=qb.indexOf(Y);if(rb!=-1){ib=Number(qb.substring(rb+u))}}catch(a){return}var sb;function tb(){if(!cb){cb=true;mb();if(ab.removeEventListener){ab.removeEventListener(Z,tb,false)}if(sb){clearInterval(sb)}}} if(ab.addEventListener){ab.addEventListener(Z,function(){tb()},false)}var sb=setInterval(function(){if(/loaded|complete/.test(ab.readyState)){tb()}},$)} -VaadinGridImport();(function () {var $gwt_version = "0.0.0";var $wnd = window;var $doc = $wnd.document;var $moduleName, $moduleBase;var $stats = $wnd.__gwtStatsEvent ? function(a) {$wnd.__gwtStatsEvent(a)} : null;var $strongName = '80368953095460DCF46286A6CF647E05';var h={3:1,4:1},aa={3:1,11:1},ba={3:1,13:1,11:1},ca={3:1,13:1,10:1,11:1},da={3:1,13:1,28:1,10:1,11:1},ea={3:1},fa={6:1,87:1,98:1},ga={105:1},ha={46:1,12:1,3:1,6:1,5:1},ia={14:1,12:1,3:1,6:1,5:1},ja={12:1,55:1,3:1,6:1,5:1},ka={12:1,56:1,3:1,6:1,5:1},la={12:1,57:1,3:1,6:1,5:1},ma={12:1,85:1,3:1,6:1,5:1},na={32:1,3:1,6:1,5:1},oa={12:1,86:1,3:1,6:1,5:1},pa={81:1,3:1,13:1,10:1,11:1},qa={16:1},ra={25:1},sa={84:1},ta={89:1,79:1},ua={184:1},va={104:1},wa={27:1,21:1,20:1,23:1,24:1,19:1,17:1},xa={27:1,21:1, +VaadinGridImport();(function () {var $gwt_version = "0.0.0";var $wnd = window;var $doc = $wnd.document;var $moduleName, $moduleBase;var $stats = $wnd.__gwtStatsEvent ? function(a) {$wnd.__gwtStatsEvent(a)} : null;var $strongName = 'B54CB3CECD7AAD680262E49C2BA25FAF';var h={3:1,4:1},aa={3:1,11:1},ba={3:1,13:1,11:1},ca={3:1,13:1,10:1,11:1},da={3:1,13:1,28:1,10:1,11:1},ea={3:1},fa={6:1,87:1,98:1},ga={105:1},ha={46:1,12:1,3:1,6:1,5:1},ia={14:1,12:1,3:1,6:1,5:1},ja={12:1,55:1,3:1,6:1,5:1},ka={12:1,56:1,3:1,6:1,5:1},la={12:1,57:1,3:1,6:1,5:1},ma={12:1,85:1,3:1,6:1,5:1},na={32:1,3:1,6:1,5:1},oa={12:1,86:1,3:1,6:1,5:1},pa={81:1,3:1,13:1,10:1,11:1},qa={16:1},ra={25:1},sa={84:1},ta={89:1,79:1},ua={184:1},va={104:1},wa={27:1,21:1,20:1,23:1,24:1,19:1,17:1},xa={27:1,21:1, 20:1,23:1,42:1,24:1,19:1,17:1},ya={27:1,21:1,20:1,113:1,23:1,24:1,19:1,17:1},Aa={90:1,15:1},Ba={27:1,21:1,20:1,23:1,137:1,24:1,19:1,17:1},Ca={27:1,21:1,20:1,112:1,23:1,42:1,24:1,19:1,17:1},Da={15:1,91:1},Ea={698:1,15:1},Fa={27:1,21:1,20:1,23:1,42:1,24:1,157:1,19:1,17:1},Ga={243:1,15:1},Ha={131:1,132:1},Ia={90:1,15:1,51:1,64:1},Ja={15:1,183:1},Ka={15:1,701:1},La={27:1,21:1,20:1,113:1,23:1,42:1,137:1,24:1,19:1,17:1,649:1},Ma={15:1,242:1,651:1,650:1},Na={62:1,3:1,6:1,5:1},Oa={243:1,27:1,15:1,21:1,20:1, 112:1,23:1,42:1,24:1,19:1,17:1},Pa={50:1,3:1,6:1,5:1},Qa={74:1,3:1,6:1,5:1},Ra={65:1},Sa={54:1},Ta={61:1},Ua={72:1,53:1},Va={3:1,61:1,246:1},Wa={3:1,65:1},Xa={3:1,54:1},Ya={3:1,6:1,5:1,60:1},_,Za,ab,bb=-1;function cb(){}function db(a,b){var c=$wnd;if(""===a)return c;var d=a.split(".");d[0]in c||!c.execScript||c.execScript("var "+d[0]);for(var e;d.length&&(e=d.shift());)c=c[e]=c[e]||!d.length&&b||{};return c}function eb(a){function b(){}b.prototype=a||{};return new b} function fb(a,b){function c(){return a.apply(c,arguments)}if(c.__proto__)c.__proto__=b;else for(var d in b)c[d]=b[d];return c}function k(){}function q(a){var b=_,c;for(c in a)a[c].configurable=!0;Object.defineProperties(b,a)}function r(a,b,c){var d=Za,e,f=d[a],g=f instanceof Array?f[0]:null;f&&!g?_=f:(_=(e=b&&b.prototype,!e&&(e=Za[b]),eb(e)),_.Tf=c,_.constructor=_,!b&&(_.Uf=cb),d[a]=_);for(d=3;de&&0<=e)throw(new E("New minimum width ("+d+") was greater than maximum width ("+e+")")).backingJsObject;c.q!=d&&(c.q=d,c.i&&ZA(c.i.a));fF(a.b)}}function IF(a,b){a.a.t!=b&&(xC(a.a,cE(b)?-1:b),fF(a.b))}function JF(){}r(195,1,{195:1},JF);_.configure=function(a,b){this.a=b;this.b=a;fE(this)};q({flex:{get:function(){return this.a.g}}});q({hidable:{get:function(){return this.a.k}}});q({hidden:{get:function(){return this.a.n}}});q({hidingToggleText:{get:function(){return this.a.o}}}); @@ -622,4 +622,4 @@ function id(){return xb(this.a)}function Mq(){}function Nq(){Jq(this)}function b function Oq(a){-1==this.Z?yp((R(),this.ab),a|(this.ab.__eventBits||0)):this.Z|=a}function sk(){return this.c}function ez(){return this.i}function px(){return this.k}function NB(){return this.v}function lw(){return this.a.c}function oF(){return this.b}function pF(){return this.d}function xs(a){return a}function iG(){return[]}function kD(){return 0}function Qb(){return this.f}function qG(){this.e=-1}function $G(){return 0==this.nd()}function ZG(a){return Vz(this,a,!1)} function bH(a){return VG(this,a)}function aH(){return this.nf(Ib(H,h,1,this.nd(),5))}function BH(){zH(this)}function tH(){return this.a.nd()}function CH(){return this.a.Xc()}function DH(){this.a.Zc()}function NH(){return this.a.length}function TH(){return hl(),UH(),VH}function XH(){throw(new pd).backingJsObject;}function dw(){return null}function KH(){return this.b.nd()}function ZH(a){return this.b.kf(a)}function aI(){return new ku(this.b.Mc())}function bI(){return this.b.mf()} function cI(a){return this.b.nf(a)}function dI(){return this.b.Xc()}function eI(){return this.b.Yc()}function fI(){YH()}function jI(){throw(new UG).backingJsObject;}function GH(){throw(new UG).backingJsObject;}function $H(){return this.b.lf()}function Dq(){throw(new UG).backingJsObject;}function gI(a){return this.a.bb(a)}function hI(){return this.a.db()};window.gwtOnLoad=gwtOnLoad;if (VaadinGridImport) VaadinGridImport.onScriptLoad(gwtOnLoad);})(); -// vaadin.elements.grid.hash = 'a3c30e0659387dae0d9a9308e77494d5b71e74c0'; +// vaadin.elements.grid.hash = 'd2c77e07977f1b9cce838c4f4e6b42581467cb75';