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

Entry with mobile.NumberKeyboard does not Type comma and separators #5101

Open
2 tasks done
BieHDC opened this issue Aug 29, 2024 · 0 comments
Open
2 tasks done

Entry with mobile.NumberKeyboard does not Type comma and separators #5101

BieHDC opened this issue Aug 29, 2024 · 0 comments
Labels
unverified A bug that has been reported but not verified

Comments

@BieHDC
Copy link
Contributor

BieHDC commented Aug 29, 2024

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

When making a numeric entry like in this official example it does not recognise comma and separator inputs, making it impossible to have a nice number only entry field with big numeric keys keyboard (important for my usecase).

How to reproduce

  1. Compile and run the example code on mobile
  2. Try to type in comma and separators as shown in the video

Screenshots

1000001124.mp4

Example code

package main

import (
	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/driver/mobile"
	"fyne.io/fyne/v2/widget"
)

// An entry widget that pops a number-only keyboard on mobile
type numberKeyboardEntry struct {
	widget.Entry
}

func (e *numberKeyboardEntry) Keyboard() mobile.KeyboardType {
	return mobile.NumberKeyboard
}

// cb is a callback that gets in true when focusing and false when unfocusing
func NewNumberKeyboardEntry() *numberKeyboardEntry {
	e := &numberKeyboardEntry{}
	e.Wrapping = fyne.TextWrap(fyne.TextTruncateClip)
	e.ExtendBaseWidget(e)
	return e
}

func main() {
	app := app.New()
	window := app.NewWindow("Bugtest - Mobile NumberKeyboard Entry")
	window.SetPadded(false)
	window.Resize(fyne.NewSize(500, 600))
	window.CenterOnScreen()

	numkey := widget.NewFormItem("NumberKeyboard", NewNumberKeyboardEntry())
	norkey := widget.NewFormItem("Normal", widget.NewEntry())
	window.SetContent(widget.NewForm(numkey, norkey))
	window.ShowAndRun()
}

Fyne version

2.5.1

Go compiler version

1.23.0

Operating system and version

Artix Linux amd64

Additional Information

No response

@BieHDC BieHDC added the unverified A bug that has been reported but not verified label Aug 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

1 participant