diff --git a/resources/vue/components/courseware/blocks/CoursewareCanvasBlock.vue b/resources/vue/components/courseware/blocks/CoursewareCanvasBlock.vue index 24a59f5a621e9ab0de410c821f3dbae9a9eb3c2c..21a52006940df26b983009c3a72c11b4431310cd 100644 --- a/resources/vue/components/courseware/blocks/CoursewareCanvasBlock.vue +++ b/resources/vue/components/courseware/blocks/CoursewareCanvasBlock.vue @@ -579,8 +579,10 @@ export default { let input = this.$refs.textInputField; input.value = ''; input.style.position = 'absolute'; - input.style.top = this.$refs.canvas.offsetTop + y + 'px'; - input.style.left = 320 + x + 'px'; + const maxBottom = this.$refs.canvas.offsetTop + this.$refs.canvas.offsetHeight - 100; + input.style.top = y < maxBottom ? this.$refs.canvas.offsetTop + y + 'px' : maxBottom + 'px'; + const leftMax = this.$refs.canvas.offsetLeft + this.$refs.canvas.offsetWidth - 320; + input.style.left = x < leftMax ? x + 'px' : leftMax + 'px'; input.style.lineHeight = fontsize + 'px'; input.style.fontSize = fontsize + 'px'; input.style.width = '300px';