smalltalk
smalltalk copied to clipboard
Select dialog
added a select dialog
Coverage decreased (-8.3%) to 84.135% when pulling 78449ade6b3da4186cd6c0dfe72a5d879fdfe6ee on hrueger:select-dialog into a009d84e2e9bf9d903711ecb37cfec829d975775 on coderaiser:master.
Unfortunately, I don't know how to write the tests... Is it ok anyway?
That's a very good idea to make such a feature :). It absolutely feats to smalltak scope, and can be reused in Cloud Commander which have own implementation for User Menu, but would be better if it used smalltalk.
Would be amazing to join Cloud Commander's implementation of select with the one you provided, for this purpose would be great to add keys support and to use smalltalk here instead of @cloudcmd/modal.
I tried to implement the key events, but unfortunately it doesnt work with selectedIndex and the arrow events, as the (I assume every browser, only tested with the latest Firefox) browser navigates in a select element with the arrow keys automatically. In the demo of cloudcommander the arrow keys and j and k keys dont give the same result... As the focus is already in the select element when the dialog is opened, I would leave the navigating with the arrow keys to the browser.
Also I have a question:
In my project AGLight I often need a dialog like this:
You can choose between two or more options and they are displayed as cards.
Can I add this to smalltalk? Or would you say that this is a bit too unusual?
@hrueger could you render template you are going to show and then just pass message as html markup?
Yes, of course I can. But I'll make a new pull request for this feature.
@hrueger good idea 🙂
I just added an option for multiple selects. Is there anything more which has to be done before this PR can be merged?
Any update on this?
Could you please get back key names?
const TAB = 9;
const event = {
keyCode: TAB,
}
Unfortunately, this causes the linting test to fail: see line 227f.
Lint is fixed :), also PR missing tests. There is select in Cloud Commander's user menu, what do you think about porting it to smalltalk :)? It has a lot features implemented, and can significantly simplify code base of a file manager, and make smalltalk benefit from select.
Thanks for the linting fix and the tests. Unfortunately, I don't have time to port this to smalltalk.