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

The onConfirm callback should be called only when user click on 'Ok' of a EntryDialog dialog. #1920

Merged
merged 1 commit into from
Feb 8, 2021

Conversation

zdima
Copy link
Contributor

@zdima zdima commented Feb 7, 2021

Description:

The onConfirm callback is getting called whether user click on Ok or Cancel button of the EntryDialog.
Such behavior doesn't allow to distinguish between Ok and Cancel actions.

The expected behavior is when onConfirm called only when use click on Ok button.

Checklist:

  • Tests included.
  • Lint and formatter run with no errors.
  • Tests all pass.

Where applicable:

Copy link
Member

@Jacalz Jacalz left a comment

Choose a reason for hiding this comment

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

Good catch. Looks to be my fault from when I reworked the Entry Dialog to use form when deprecating it. Given that this is a bugfix to a slight behavior change, I think this should be backported to 2.0.1.

Copy link
Member

@stuartmscott stuartmscott left a comment

Choose a reason for hiding this comment

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

Unfortunately the dev has no way to handle the case where the dialog was cancelled. Perhaps an onCancelled func() should be added, or onConfirm func(string) should become callback func(string, bool), but either way is an API break.

However this limitation was not introduced by this PR, so approved.

@Jacalz
Copy link
Member

Jacalz commented Feb 7, 2021

Unfortunately the dev has no way to handle the case where the dialog was cancelled. Perhaps an onCancelled func() should be added, or onConfirm func(string) should become callback func(string, bool), but either way is an API break.

That is true, but I am not entirely sure if we should add new features to a deprecated dialog.

@andydotxyz
Copy link
Member

Unfortunately the dev has no way to handle the case where the dialog was cancelled

I don’t think this is the case. All dialogs have OnClosed if you want to be informed that it went away.

@Jacalz Jacalz merged commit 6193bd8 into fyne-io:develop Feb 8, 2021
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

4 participants