Skip to content

Commit ae3a815

Browse files
authored
fix: set activeTab to properties tab on create sample action (#2608)
* fix: set activeTab to properties tab on create sample action * fix: set ActiveTab to sample properties tab on clicking add new material in reaction scheme
1 parent 8f84c63 commit ae3a815

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

app/javascript/src/components/contextActions/CreateButton.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ import ElementActions from 'src/stores/alt/actions/ElementActions';
1111
import ClipboardActions from 'src/stores/alt/actions/ClipboardActions';
1212
import SamplesFetcher from 'src/fetchers/SamplesFetcher';
1313
import MatrixCheck from 'src/components/common/MatrixCheck';
14+
import UIActions from 'src/stores/alt/actions/UIActions';
1415

1516
const elementList = () => {
1617
const elements = [
@@ -281,6 +282,9 @@ export default class CreateButton extends React.Component {
281282
if (genericEls.find(el => el.name == type)) {
282283
e.klassType = 'GenericEl';
283284
}
285+
if (type === 'sample') {
286+
UIActions.selectTab(0);
287+
}
284288
elementShowOrNew(e);
285289
}
286290

app/javascript/src/stores/alt/actions/ElementActions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -533,6 +533,7 @@ class ElementActions {
533533
}
534534

535535
addSampleToMaterialGroup(params) {
536+
UIActions.selectTab(0);
536537
return params;
537538
}
538539

0 commit comments

Comments
 (0)