You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
change the minimum height of the iframe used for LTI messages
why
The iframe used for LTI messages has 450px as minimum height
When the user zooms in the browser (3-400%) the visible viewport
will be much smaller than the min-height (450px) of the iframe
which causes problem and the focused elements are not visible
Instead of setting an absolute value for this property, we can
use 100% of the iframe's height
fixes INTEROP-7093
flag=none
Test plan
Compile the CSS. Run:
rake css:compile
Compile the JS. Run:
rake js:webpack_development
Launch any LTI tool
Open the Browser Developer Tools (F12)
Locate the HTML element iframe#tool_content
Check the height property of the iframe. It should allow values
below 450px when zooming in
I did some additional digging for the issue that my colleague mentioned above and poured it in your issue reporting format:
Summary: Missing launch_height configuration in LTI 1.3
We recently migrated our Canvas App/Tool to LTI 1.3 from LTI 1.1 but the configuration does not have a launch_height.
Now normally if our tool wasn't used it would take up (almost) no space because we set the launch height to a really low value or zero.
We're using the lti.frameResize to resize the iframe but looking at the JavaScript/React code it expects the launch_height to unset the minimum height in the styling.
See:
if (tool.placements[this.props.placement].launch_height) {
styles.height = tool.placements[this.props.placement].launch_height
styles.minHeight = 'unset'
}
in ui/shared/assignments/react/AssignmentExternalTools.jsx
However, the (LTI 1.3) tool configuration does not seem to provide a way to set the launch_height, only the selection_height.
Using your development environment I can add the launch_height by adding this code to lib/lti/app_launch_collator.rb
if tool.extension_setting(p, "selection_height")
definition[:placements][p.to_sym]["launch_height"] = tool.extension_setting(p, "selection_height")
end
in the lti1_launch_definition method which solves the issue of the Tool's launch height but:
It feels like a hack
I'm unsure this is a proper Ruby/code-base solution; Ruby is not a language I normally write code in
There's already code which should add the launch_height
Steps to reproduce:
I hope the summary above is sufficient, it's hard to reproduce because the LTI 1.3 seems to be missing the launch_height setting and it is not a simple "perform these steps and watch it break"
Expected behaviour:
The lti.frameResize feature from Canvas resizes the window to any desired height (also below the minimum because the minHeight is unset).
Additional notes:
LTI 1.1 launch_height configuration example from our App/Tool:
Using LTI 1.3.
It is impossible to override the iframe height in a smaller size than 450px. which makes it hard for other plugins to be visible properly.
// Send the resize message to Canvas try { window.parent.postMessage({ subject: 'lti.frameResize', height: '200px', 'min-height': '200px', max_height: '200px', token: token }, '*'); } catch (e) { console.error('Failed to send resize message:', e); }
Smaller then 450px will just not happen. The previous 100% worked properly. Shouldnt the minimum height be applied to the component where it belongs?
078a06d
change the minimum height of the iframe used for LTI messages
why
The iframe used for LTI messages has 450px as minimum height
When the user zooms in the browser (3-400%) the visible viewport
will be much smaller than the min-height (450px) of the iframe
which causes problem and the focused elements are not visible
Instead of setting an absolute value for this property, we can
use 100% of the iframe's height
fixes INTEROP-7093
flag=none
Test plan
Launch any LTI tool
Open the Browser Developer Tools (F12)
Locate the HTML element iframe#tool_content
Check the height property of the iframe. It should allow values
below 450px when zooming in
Change-Id: I4b20909d3accdb00de3320de7b3ecc61997e4df0
Reviewed-on: https://gerrit.instructure.com/c/canvas-lms/+/282126
Tested-by: Service Cloud Jenkins [email protected]
Product-Review: Karl Lloyd [email protected]
Reviewed-by: Tucker Mcknight [email protected]
QA-Review: Tucker Mcknight [email protected]
The text was updated successfully, but these errors were encountered: