-
Notifications
You must be signed in to change notification settings - Fork 16
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
Move virtual keyboard outside iframe #204
Conversation
Broke keyboard for case if don't have iframe
Got the keyboard to work for the case when we have the iframe. The keyboard no longer works if don't have an iframe. Presumably, we need to have |
I think something in the global doenetConfig should be set if we're in an iframe. The |
We don't need to know if we are in any iframe; we need to know specifically if we are in an iframe created by the |
The idea would be that the global config would be set by |
I'm not sure how to make |
@@ -21,6 +21,7 @@ document.addEventListener("DOMContentLoaded", () => { | |||
undefined, | |||
{ | |||
...doenetEditorProps, | |||
keyboardIsOutsideIframe: true, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This isn't really about whether the keyboard is outside the iframe, as whether the built-in keyboard should be suppressed. Maybe externalVirtualKeyboardProvided
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
True, though we do then assume that messages come in from window.parent
. Not sure if that exists other than with an iframe. I'm happy to rename the prop, though.
count: number; | ||
keyboardDomNode: HTMLElement | null; | ||
keyboardReactRoot: Root | null; | ||
callbacks: OnClick[]; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would look better defined as a type. They you can do
const virtualKeyboardState: VirtualKeyboardState = (window as any).virtualKeyboardState || { ... }
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done, though now I set window.virtualKeyboardState every time since I don't have an if statement
69538e7
to
1c14250
Compare
6696380
to
a18c000
Compare
This PR moves the virtual keyboard outside the iframe if DoenetViewer or DoenetEditor are access via
doenetml-iframe
. This allows the keyboard to placed at the bottom of the browser window regardless of the size of the iframe.