Skip to content

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

@CuriousMagpie
Copy link
Contributor

Ran this locally and it looks good to me!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants