Focus layer contextmenu when opened with Shift+F10#750
Focus layer contextmenu when opened with Shift+F10#750AliyanH merged 11 commits intoMaps4HTML:mainfrom
Conversation
|
Another bug found tabbing to layer contextmenu here and pressing enter/space on the checkbox does not uncheck it. |
|
Just having a look at this now. The _changeExtent event handler function is responsible for handling the change even on this input. The event handler is / should be created in the MapMLLayer.getLayerExtentHTML(labelName, i) function call, which is run after the fetch / xhr has happened. It may be that there is a timing issue going on, or it could be a Leaflet upgrade issue. Not sure ATM, will investigate further. |
|
|
||
| // focus the first layer in the layer control when enter is pressed | ||
| _focusFirstLayer: function(e){ | ||
| if(e.key === 'Enter' && this.className != 'leaflet-control-layers leaflet-control leaflet-control-layers-expanded'){ |
There was a problem hiding this comment.
The event was on _container before, but I can't understand why the != here didn't prevent _focusFirstLayer from having the desired effect.
|
This is the commit that caused the spacebar to stop working, but it may have something to do with the code block starting at line 361 of mapml-viewer.js in that commit (which handles "space" key 32). Same considerations likely apply to web-map.js. I'm pretty sure that was my fault; changes were made to remove parentElement without due consideration. I'm not sure if it is why the checkbox no longer focused automatically when the layer control is opened. I went back quite far in history and I found that the behaviour of Enter to open vs the layer control just opening when focused has changed a few times. |
Thanks @prushforth, good catch! I am not sure if the parentElement was the issue. That commit was handling the space key for all of mapml-viewer and preventing the default behavior for the space key. I have added an exception to input elements as of now. |
Fixes bug caused by leaflet1.9.3 upgrade
resolves #747.