Skip to content
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

Fix chat autocomplete after accepting community guidelines #15250

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

rafJagCode
Copy link
Contributor

The row containing the chat textarea is conditionally rendered with the v-if directive based on the acceptance of community guidelines. This means that when the chat.vue component is mounted, the textarea reference is undefined, causing autoComplete.vue to try to access properties of an undefined textbox prop.

// chat.vue
mounted () {
  this.textbox = this.$refs['user-entry']; // this.textbox = undefined
},

//autoComplete.vue
const caretPosition = this.textbox.selectionEnd; // // Trying to access the selectionEnd property of an undefined value
<!-- Fix: Use a ref function to set the textbox when the textarea has been rendered -->
 <textarea :ref="setTextbox"></textarea>

UUID: 01148fda-c7f3-4668-a83d-e519eaf9407c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant