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

Form submit button remains disabled after pasting text into a MultiLineEntry with custom validation #5028

Closed
2 tasks done
agukrapo opened this issue Jul 24, 2024 · 2 comments
Labels
bug Something isn't working duplicate This issue or pull request already exists

Comments

@agukrapo
Copy link

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

Pasting text into a MultiLineEntry with custom validation won't enable the submit button

How to reproduce

  1. Run example code
  2. Paste text into MultiLineEntry
  3. Submit button still disabled

Screenshots

No response

Example code

package main

import (
	"errors"
	"fmt"

	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/widget"
)

func main() {
	w := app.New().NewWindow("test")
	w.Resize(fyne.NewSize(500, 100))

	txt := widget.NewMultiLineEntry()
	txt.Validator = func(s string) error {
		if s == "" {
			return errors.New("empty")
		}
		return nil
	}

	form := &widget.Form{
		OnSubmit: func() {
			fmt.Println("OnSubmit")
		},
	}
	form.Append("txt", txt)

	w.SetContent(form)
	w.ShowAndRun()
}

Fyne version

fyne.io/fyne/v2 v2.5.0

Go compiler version

go1.22.5 darwin/arm64

Operating system and version

macOS 14.5, windows 10

Additional Information

I was able to fix it with this workaround:

txt.OnChanged = func(s string) {
_ = txt.Validate()
}
@agukrapo agukrapo added the unverified A bug that has been reported but not verified label Jul 24, 2024
@andydotxyz andydotxyz added bug Something isn't working and removed unverified A bug that has been reported but not verified labels Sep 4, 2024
@andydotxyz andydotxyz added this to the E fixes (v2.5.x) milestone Sep 4, 2024
@andydotxyz
Copy link
Member

Ah yes, it seems paste is not triggering the change events

@pierrec
Copy link

pierrec commented Sep 14, 2024

Duplicate of #5058.

@andydotxyz andydotxyz added the duplicate This issue or pull request already exists label Sep 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants