parent=stage focus issue?

  • Dear Klaus!
    I just tried to create a plugin that is displayed alongside the panorama, instead of over the image, by setting the plugins parent to stage. It all looks good, but when I put an input element in this plugin, it's very hard to get focus in it, meaning if I just single-click it, nothing happens, no matter how many times I try. If I double click, again nothing happens. But if I start clicking like mad, sometimes it finally gets focus. Please note this only happens with type=text inputs, buttons work just fine.

    I'm pretty sure this has something to do with the parent=stage setting, because if I remove that line and the plugin appears inside the area, this behavior stops immediately.


    Is this a bug perhaps? Any workarounds?

    Update: did some search on the forum and found out that there has been some similar issues, but the topics are dated back to 2011, and it was still in the flash-based viewer, so I guess that's a completely different animal. In any case I tried the setting parent=bglayer aswell, but the same issue persists, in fact it's even worse, this time I wasn't able to get the focus in the input at all, no matter how many times and how fast I tried to click *tongue*

    Update2: looking around in the debugger it seems that there is some kind of internal krpano (mousedown) event listener preventing the textfield from getting the focus, when I remove that it starts working immediately.

    3 Mal editiert, zuletzt von webseta (14. Juni 2018 um 23:17)

  • Hi,

    the krpano viewer manages the mouse and touch events for its elements by its own.

    Otherwise controlling wouldn't work and to avoid that the page would be scrolled/dragged around when dragging a krpano element, the krpano event handling need to suppress/prevent the default event behavior of the browser on these elements.

    It works as it should but can become problematic/conflicting when mixing it with other/external elements - e.g. input elements might depend on that their parent element would do the browsers default event processing. The next is using stage=parent - in this case krpano puts that element outside of the its own control element that handles/tracks the events, by that the event handling become even more complicated when combination with external stuff...

    Maybe post your example (as reduced as possible), maybe it's possible to find a manual solution...

    Best regards,
    Klaus

  • Open this link, close the black info layer that pops up, wait 3 seconds and then a layer will slide in from the left. At the top, there's an input field, this is the one I'm having trouble to get focus into. I appreciate what you wrote and how these things aren't easy, but it would be great if there was some kind of a workaround :)

    Cheers!

  • What do you mean?

    In the documentation it says:
    "Note - all <layer> or <plugin> elements will be placed
    inside this area. To place a <layer> or <plugin> element
    outside that area, set the parent attribute of that layer / plugin element to "STAGE"."

    I need the plugin to be outside the area.

  • Anyway, I was actually able to solve this by giving it focus programmatically on a click. Not a nice/ideal solution, but works for now.

    One big issue is that this way I the care in the input can only be placed at the end of the text, so it's not possible to click into a specific position or to select the text inside it. Is there perhaps a workaround, or a fix planned for this?

    Einmal editiert, zuletzt von webseta (26. September 2018 um 19:23)

  • HI KLAUS,

    I agree with webseta, placing a layer outisde the area using parent=stage is usefull but very unfortunately we lose control when doing this in Internet Explorer on that particular layer.

    But this works fine in firefox/chrome, the mouse events are correctly passed

    any way this could work the same with IE ?

    this is so usefull....

  • Looks it's only buggy on touch screens (i'm using surface studio)

    Edge on a non touch screen works fine with parent=stage

    on the surface, if you happen to touch a parent=stage, then it completely loses focus

  • Oh yeah, I just realized that on mobile (android, chrome) it's not working at all, not just the text input fields but even buttons stop working.

    Klaus, is there a workaround or a planned bugfix for this?

Jetzt mitmachen!

Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!