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

SpSelectDialog should select the first item #1530

Closed
Ducasse opened this issue Mar 29, 2024 · 6 comments
Closed

SpSelectDialog should select the first item #1530

Ducasse opened this issue Mar 29, 2024 · 6 comments

Comments

@Ducasse
Copy link
Contributor

Ducasse commented Mar 29, 2024

SpSelectDialog should select the first item.

@Ducasse Ducasse changed the title SpDialog should select the first item SpSelectDialog should select the first item Mar 29, 2024
@estebanlm
Copy link
Member

you mean like by default?

@Ducasse
Copy link
Contributor Author

Ducasse commented Apr 4, 2024

Yes. And may be with a message not to do it for people that do not understand UX.
Like that we can often do enter and get done :)

@estebanlm
Copy link
Member

estebanlm commented Apr 4, 2024

Uhm... it seems is already like that:

SpSelectDialog>>items: aCollection

	list items: aCollection.
	aCollection size > 1
		ifTrue: [ list selectItem: aCollection first ]

and testing it, it seems to work:

StPharoApplication current newSelect
	items: #(x y z);
	openModal.

EDIT: And now that I see, you did that, in December :)

@estebanlm
Copy link
Member

maybe better just to ask for not empty, instead size?

@Ducasse
Copy link
Contributor Author

Ducasse commented Apr 5, 2024

This is strange because in some refactorings the first item is not selected and this is why I thought that we lost it.
Yes size > 1 is a bad idea since this is my bug. If you have a list with only element then you still want to select it.
Good cath!

@Ducasse
Copy link
Contributor Author

Ducasse commented Apr 5, 2024

So it was not lost but I just badly coded it.

estebanlm added a commit that referenced this issue Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants