I am working on leaflet map and trying to show popup (<l-popup), when I press ENTER key and also when my marker is on active state then when on Enter press the popup show popup. I have looked through leaflet map doc : https://vue2-leaflet.netlify.app/components/LPopup.html#demo but cannot find any props or event that do what I want.
<l-marker
v-for="(loc, index) in locations"
:key="index"
@keydown.enter="openPopupOnEnterPress(index)"
// @keyup.enter = "showPopup = true"
>
data() {
return {
showPopup: false,
}
}
methods: {
openPopupOnEnterPress(e) {
if (e.keyCode === 13 || e.key === "Enter") {
alert("Enter was pressed");
} else {
console.log("Enter was not pressed");
}
},
}
The event or the function openPopupOnEnterPress(e) doesnot event triggers at all. Any help will be much appreciated
<l-marker
v-for="(loc, index) in locations"
:key="index"
@keydown.enter.native="openPopupOnEnterPress(index)"
tabindex="0"
/>