Texts in the web page are still selectable and interactive #9292
Unanswered
mandudeman
asked this question in
Help/Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
``
{{ __('Rationale') }}
<script> import VideoAttachment from "@/Components/Questions/Attachments/VideoAttachment"; export default { name: 'PracticeSolutionCard', components: { VideoAttachment }, props: { question: Object, }, created() { this.$nextTick(function() { window.renderMathInElement(this.$el); this.setupPreventTextSelection(); // Call the method to set up event listeners }); }, methods: { setupPreventTextSelection() { const solutionContent = this.$refs.solutionContent; solutionContent.addEventListener('contextmenu', (e) => { e.preventDefault(); // Prevent right-click menu }); solutionContent.addEventListener('selectstart', (e) => { e.preventDefault(); // Prevent text selection }); solutionContent.addEventListener('mousedown', (e) => { if (e.ctrlKey) { e.preventDefault(); // Prevent Ctrl + Click } }); solutionContent.addEventListener('copy', (e) => { e.preventDefault(); // Prevent text copying }); } } } </script>
Beta Was this translation helpful? Give feedback.
All reactions