smalltalk icon indicating copy to clipboard operation
smalltalk copied to clipboard

Select dialog

Open hrueger opened this issue 6 years ago • 14 comments

added a select dialog

hrueger avatar Oct 25 '19 21:10 hrueger

Coverage Status

Coverage decreased (-8.3%) to 84.135% when pulling 78449ade6b3da4186cd6c0dfe72a5d879fdfe6ee on hrueger:select-dialog into a009d84e2e9bf9d903711ecb37cfec829d975775 on coderaiser:master.

coveralls avatar Oct 25 '19 21:10 coveralls

Unfortunately, I don't know how to write the tests... Is it ok anyway?

hrueger avatar Oct 26 '19 03:10 hrueger

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.

coderaiser avatar Oct 26 '19 10:10 coderaiser

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.

hrueger avatar Oct 27 '19 01:10 hrueger

Also I have a question: In my project AGLight I often need a dialog like this: grafik 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 avatar Oct 27 '19 01:10 hrueger

@hrueger could you render template you are going to show and then just pass message as html markup?

coderaiser avatar Oct 28 '19 08:10 coderaiser

Yes, of course I can. But I'll make a new pull request for this feature.

hrueger avatar Oct 28 '19 17:10 hrueger

@hrueger good idea 🙂

coderaiser avatar Oct 28 '19 17:10 coderaiser

I just added an option for multiple selects. Is there anything more which has to be done before this PR can be merged?

hrueger avatar Oct 31 '19 21:10 hrueger

Any update on this?

hrueger avatar Nov 09 '19 19:11 hrueger

Could you please get back key names?

const TAB = 9;
const event = {
    keyCode: TAB,
}

coderaiser avatar Nov 11 '19 08:11 coderaiser

Unfortunately, this causes the linting test to fail: see line 227f.

hrueger avatar Nov 11 '19 16:11 hrueger

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.

coderaiser avatar Jan 07 '20 11:01 coderaiser

Thanks for the linting fix and the tests. Unfortunately, I don't have time to port this to smalltalk.

hrueger avatar Jan 07 '20 20:01 hrueger