Skip to content

Proposal: UX/A11y - Make widget/Entry select all text when tabbed into #6137

@schnoddelbotz

Description

@schnoddelbotz

Checklist

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

Is your feature request related to a problem?

Currently, when tabbing through multiple fyne widget.Entry form fields, text of active entry will not be selected. In contrast to (most? all?) web browsers - they will select the content when tabbing from one <input type="text"> field to the next; users might be used to this behavior and it's probably more efficient.

HTML form example that displays said behavior:

<form>
  <input type="text"> 
  <input type="text" value="test 123">
  <input type="text">
  <textarea>Foo bar</textarea>
</form>

Is it possible to construct a solution with the existing API?

I don't think that it's currently possible, as there are no public Entry methods to e.g. SelectAllText().

Describe the solution you'd like to see.

It would possibly be a rather small change in the FocusGained() method:

func (e *Entry) FocusGained() {

	if !e.MultiLine {
		e.sel.selecting = true
		e.sel.selectCurrentRow(true)
	}

This would keep behavior consistent with browsers, who also do not select textarea contents on focus.
It seemingly doesn't interfere with e.g. mouse clicking into an Entry -- no selection happening.

If enabling this by default is not desired, having a bool toggle on the Entry widget would be great, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions