OSC / bc_js_filepicker

A file picker for Batch Connect applications
MIT License
2 stars 6 forks source link

can't select favorites #206

Closed stdweird closed 1 year ago

stdweird commented 1 year ago

i have OOD 2.0.29 and filepicker 1.0.0.

the picker is for selecting directories and i have bunch of favorites defined.

however, when i select a favorite, and then press the select button, nothing is done. i need to select one of the subdirs first. and also strange (or even buggy?) i can't select the . or .. dirs.

this makes the favorites a bit useless in our case, as i can't select the favorites themself

stdweird commented 1 year ago

there was nothing in the release notes of v3 about this, so i haven tried (and it's not trivial for me to update anyway)

johrstrom commented 1 year ago

There's likely some bug here in this library. I may be able to get around to this, but this library is being replaced with a native ood widget in https://github.com/OSC/ondemand/issues/1571 that will come with OnDemand 3.1.

stdweird commented 1 year ago

if you have some vague idea where i should look, i can give it a try myself. probably something simple is missing, but i'm not sure where to start looking

stdweird commented 1 year ago

i only now also see this is a dupe of #204

johrstrom commented 1 year ago

here's the event handler for when things are clicked. that may be a starting point.

https://github.com/OSC/bc_js_filepicker/blob/f854d9258baf570c6b0f375badcfa975722b29fd/src/components/file_picker.vue#L197

stdweird commented 1 year ago

@johrstrom i think the fix might be simple: when a menu is clicked (but most likely also when an entry is doubleclicked), the this.staged_value should be set to this.path. i'll test this, but i can't easily think of a reason why not to do this.

with current code, it looks like if eg you select a file, and then later click the menu or double click a directory entry; the last entry that was clicked is the one that is still considered as "selected"; even when the viewer is showing something entirely different. that makes no sense imho.

stdweird commented 1 year ago

@johrstrom i confirm the PR fixes the behaviour.

johrstrom commented 1 year ago

I'm having trouble replicating. I see your initial comment you're using v1.0.0. Can you replicate the issue with the latest version?

https://github.com/OSC/bc_js_filepicker/releases/tag/v3.0.1

stdweird commented 1 year ago

@johrstrom how odd. the patch is against current master, so there is no way in the code that clikcing the menu would set the staged_value. anyway, will give it a try

stdweird commented 1 year ago

@johrstrom with 3.0.1 menuclick does not work, but doubleclick does seem to work (still odd, maybe i mistested it in 1.0.0 as well). see webm screencast https://we.tl/t-AWlQosNQ71

stdweird commented 1 year ago

i retested it with 1.0.0. doubleclick indeed works (maybe it always triggers a single click?) anyway, i adapted the PR to only fix the favorites