Skip to content

Commit

Permalink
Fix bug in dyn dropdown select - could no longer have "new" input whi…
Browse files Browse the repository at this point in the history
…ch is not in the select list
  • Loading branch information
glormph committed Dec 19, 2024
1 parent 18bfe22 commit c6fdb17
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 0 additions & 1 deletion src/frontend/datasets/src/DynamicSelect.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ export function inputdone() {
if (selectval && selectval in fixedoptions) {
intext = niceName(fixedoptions[selectval]);
} else {
intext = '';
selectval = false;
}
if (!mouseSelect) {
Expand Down
10 changes: 9 additions & 1 deletion src/frontend/datasets/src/MSSamplePrepComp.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ export let errors;
let samplepreperrors = [];
let useTrackingPipeline = false;
let selectedPipeline = false;
let pipelineName = '';
let pipelines = {};
let pipeselector;
let dset_pipe_id;
Expand Down Expand Up @@ -77,6 +78,8 @@ function togglePipeline() {
if (useTrackingPipeline) {
useTrackingPipeline = false;
selectedPipeline = false;
// Blank the pipeline name from the selector
pipelineName = '';
// If we run immediately then the selectedPipeline will not be updated yet
setTimeout(pipeselector.inputdone, 20);
editMade();
Expand Down Expand Up @@ -117,7 +120,12 @@ onMount(async() => {
<div class="field">
<label class="label">Sample prep pipeline</label>
<input type="checkbox" on:change={togglePipeline} checked={useTrackingPipeline}>Use a tracking pipeline
<DynamicSelect bind:this={pipeselector} placeholder="Type to select an active, locked pipeline" fixedoptions={pipelines} bind:selectval={selectedPipeline} niceName={x => x.name} on:selectedvalue={pipelineSelected} />
<DynamicSelect bind:this={pipeselector} placeholder="Type to select an active, locked pipeline"
fixedoptions={pipelines}
bind:intext={pipelineName}
bind:selectval={selectedPipeline}
niceName={x => x.name}
on:selectedvalue={pipelineSelected} />
</div>

{#if useTrackingPipeline && selectedPipeline && dset_pipe_id}
Expand Down

0 comments on commit c6fdb17

Please sign in to comment.