leaflet-search icon indicating copy to clipboard operation
leaflet-search copied to clipboard

Enter Button does not submit

Open kaio328 opened this issue 8 years ago • 3 comments

Enter does not submit but collapses the search field.

This is the code:

case 13: if(this._countertips == 1) this._handleArrowSelect(1); this._handleSubmit(); break;

Why is it not working?

If i add this._handleSubmit(); for example to case 27 // Esc its working...

kaio328 avatar Jan 19 '17 11:01 kaio328

The reason seems to be that Leaflet itself catches the enter key and transforms it into a click event, see _handleDOMEvent in leaflet source.

gerdint avatar Dec 01 '17 14:12 gerdint

But I can see that this behavior has been removed in Leaflet 1.2. (I am on 1.0.3)

@kaio328 Does this reproduce for you in Leaflet 1.2?

gerdint avatar Dec 01 '17 15:12 gerdint

I can confirm that this does not reproduce for me if I backport the 1.2 behavior to 1.0.3.

gerdint avatar Dec 01 '17 15:12 gerdint