-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add document owner property to touch backend #2848
Add document owner property to touch backend #2848
Conversation
…be attached to instead of defaulting to the root document.
…o in touch backend.
LGTM, does the HTML5 backend need a similar configuration? |
Yes I believe it will but I haven't tested as I only needed the touch backend. I'll take a look at why tests are failing. |
In CI I am seeing a message about "some workspaces had changes but had no instructions on how they should be released" do you know how I can resolve this ? |
Try running ‘yarn version check —interactive’ to create a semver impact document
…Sent from my iPhone
On Nov 13, 2020, at 4:00 AM, James Campbell ***@***.***> wrote:
In CI I am seeing a message about "some workspaces had changes but had no instructions on how they should be released" do you know how I can resolve this ?
—
You are receiving this because you were assigned.
Reply to this email directly, view it on GitHub, or unsubscribe.
|
Just added a patch release strategy hopefully that helps |
@jcampbell05 Can you grant me write access on your branch? |
You will now have access |
Hmm, I'm having trouble pushing. Can you look on the right side of the PR? There should be a checkbox that says "allow edits by maintainers" or something to that effect. |
Doesn't show up unfortunately, I sent you an invite to my repo instead can you accept that and see |
* Allow client application to provide an ownerDocument that events can be attached to instead of defaulting to the root document. * Prefer owner document over window document. * Adds ability to specify a custom document for events to be attached to in touch backend. * Patch release strategy. * chore: cut semver document * feat: add document to html5 and touch backend contexts * chore: use minor version Co-authored-by: james <[email protected]>
Merged with #2859 |
* Allow client application to provide an ownerDocument that events can be attached to instead of defaulting to the root document. * Prefer owner document over window document. * Adds ability to specify a custom document for events to be attached to in touch backend. * Patch release strategy. * chore: cut semver document * feat: add document to html5 and touch backend contexts * chore: use minor version Co-authored-by: james <[email protected]>
In certain projects such as the one I am working on elements are encapsulated so that they are in their own sandbox. In modern browsers you would do this with the ShadowDOM but since we have to support IE 11 we cannot use that API.
We could use a Polyfill but as we are an SDK that would add unneeded weight. Instead we encapsulate by mounting our element within an iframe.
Unfortunately that breaks some assumptions this library makes. The element is now owned by the document of the iframe and not the root document object meaning events can only be listened to from the document object for the iframe.
The library assumes that it will always be able to get these events from the global document for the window. In this PR I provide an ownerDocument option which allows the consuming project to provide it's own document object for the touch backend to attach its events to.
So within the encapsulated component you can pass in a ref to a
div
element's ownerDocument to the backend, like so:Similar changes will need to be made for the HTML5 backend but I wanted to keep this PR focused on one backend.