Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TextArea is not focusable inside MapInteraction #40

Open
andriadze opened this issue Sep 30, 2019 · 2 comments
Open

TextArea is not focusable inside MapInteraction #40

andriadze opened this issue Sep 30, 2019 · 2 comments

Comments

@andriadze
Copy link

I think the problem is with preventDefault-s onMouseDown/Up, but I'm not sure.

To reproduce: add textarea inside MapInteraction component

I did it with provided example project.

@ghost
Copy link

ghost commented Oct 24, 2019

You can solve this by creating a event handler on the textarea for mousedown that calls stopPropagation. This handler needs to be created as a native jandler with 'AddEventListner' as react event handlers are ran after native ones.

@andriadze
Copy link
Author

Yeah that is one workaround. But it fails for me in couple of cases. For example there are some components that simply don't expose enough for me

I've found following in the sources:

/*
    Event handlers
    All touch/mouse handlers preventDefault because we add
    both touch and mouse handlers in the same session to support devicse
    with both touch screen and mouse inputs. The browser may fire both
    a touch and mouse event for a *single* user action, so we have to ensure
    that only one handler is used by canceling the event in the first handler.
    https://developer.mozilla.org/en-US/docs/Web/API/Touch_events/Supporting_both_TouchEvent_and_MouseEvent
  */

This is probably what's causing my issues.
Easiest solution for me in this case was to remove those preventDefault-s since I don't really care about mobile. But, I believe that is a very rough solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant