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

Issue with Entry's Placeholder #1193

Closed
antonmaju opened this issue Jul 17, 2020 · 8 comments
Closed

Issue with Entry's Placeholder #1193

antonmaju opened this issue Jul 17, 2020 · 8 comments
Labels
bug Something isn't working
Milestone

Comments

@antonmaju
Copy link

Issue:
If entry has both placeholder and text value, it will still render both text and placeholder initially.
This causes text to be hard to read.

Expected:
Entry won't render placeholder if text is present.

image

Device Info

  • OS: Tested on Windows 10 & Ubuntu 18.04
  • Go version: 1.14
  • Fyne version: 1.3.2
@andydotxyz
Copy link
Member

Thanks for the report, not sure how this slipped in.
Does it fix if you resize, or only if you type something?

@andydotxyz andydotxyz added the bug Something isn't working label Jul 17, 2020
@andydotxyz andydotxyz added this to the 1.3.x milestone Jul 17, 2020
@antonmaju
Copy link
Author

Hi @andydotxyz,
Performing resize doesn't fix the issue, but getting focus or calling FocusGained() manually fixes it

@andydotxyz
Copy link
Member

For some reason I am struggling to replicate this sorry - can you share the code that exhibits that result please?

@antonmaju
Copy link
Author

Hi @andydotxyz

The example is like this

import (
	"fyne.io/fyne"
	"fyne.io/fyne/app"
	"fyne.io/fyne/layout"
	"fyne.io/fyne/widget"
)

func TextBoxTest() {
	wApp := app.New()
	w := wApp.NewWindow("Fyne Test")
	w.Resize(fyne.Size{ Width: 400, Height: 300})
	w.SetFixedSize(true)
	lblTitle := widget.NewLabel("Title")
	txtTitle := widget.NewEntry()
	txtTitle.Text = "Test"
	txtTitle.SetPlaceHolder("Default text")
	//txtTitle.FocusGained()
	content := fyne.NewContainerWithLayout(layout.NewVBoxLayout(), lblTitle, txtTitle)
	w.SetContent(content)
	w.ShowAndRun()
}

Thanks !

@andydotxyz
Copy link
Member

Oh thanks so much - our test utility was somehow not triggering this bug but now I can replicate/

andydotxyz added a commit to andydotxyz/fyne that referenced this issue Jul 18, 2020
@antonmaju
Copy link
Author

HI @andydotxyz

Sorry I just realized, if I use SetText method instead of Text property directly it works.

@andydotxyz
Copy link
Member

Not a problem, that's a fix on develop now if you'd like to test :)

@Conan520
Copy link

I also had this problem, but I fixed it with SetText(""), I don't know why

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants