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(comp:textarea): measureTextarea removeChild error #1492

Merged
merged 1 commit into from Mar 6, 2023

Conversation

sallerli1
Copy link
Contributor

PR Checklist

Please check if your PR fulfills the following requirements:

  • The commit message follows our guidelines
  • Tests for the changes have been added/updated or not needed
  • Docs and demo have been added/updated or not needed

What is the current behavior?

removeChild 调用时,clonedTextarea 并不是其子元素

What is the new behavior?

增加判断,解决以上问题

Other information

@idux-bot
Copy link

idux-bot bot commented Mar 6, 2023

This preview will be available after the AzureCI is passed.

textarea.parentNode!.removeChild(clonedTextarea)
if (clonedTextarea.parentNode) {
clonedTextarea.parentNode.removeChild(clonedTextarea)
}

return measureRes
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

with a brief review of the code patch

The patch adds an extra conditional check to ensure that the clonedTextarea element has a parent node before proceeding to delete it. This is a good practice as it ensures that any dependencies to the element are handled properly and prevents potential errors. The code also looks well structured and it is easy to read. Therefore, I suggest no changes to this code.

@danranVm danranVm merged commit e489e8e into IDuxFE:main Mar 6, 2023
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

2 participants