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

ensure output field is cleared when input field is empty #24

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

Conversation

ansuz
Copy link

@ansuz ansuz commented Sep 17, 2022

Hi!

This patch addresses #7 in two cases:

  1. When key events on the input field would trigger a call to the worker for the text's translation, if the input is blank (consisting of nothing or whitespace), clear the output field immediately.
  2. Because the worker call is asynchronous, a translation result can be returned and displayed after the output field has already been cleared. In such cases it checks whether the input field is blank, clears the output (as a precaution) and returns before it would normally display the result.

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