Skip to content

Commit

Permalink
feat(framemanager): emit click event to host when client clicked
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas-c-dillon committed Jan 19, 2023
1 parent 9c204b3 commit 7b75f46
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/iframe-coordinator/src/FrameManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ to bad data passed to a frame-router method.
if (event.data.protocol === API_PROTOCOL) {
throw new Error(
`
I recieved an invalid message from the client application. This is probably due
I received an invalid message from the client application. This is probably due
to a major version mismatch between client and host iframe-coordinator libraries.
`.trim() +
'\n' +
Expand All @@ -229,6 +229,12 @@ to a major version mismatch between client and host iframe-coordinator libraries
event.origin === expectedClientOrigin &&
event.source === this._iframe.contentWindow
) {
if (validated.msgType === 'clickFired') {
/** Simulate a click on the iframe when a click is reported from the client.
* This allows a click event to bubble through the host to provide expected behaviors for things like dropdowns and modals.
*/
this._iframe.click();
}
handler(validated);
}
}
Expand Down

0 comments on commit 7b75f46

Please sign in to comment.