Refactor FormattedDropdown and enhance BranchView functionality
- Updated the FormattedDropdown component to use normal document flow for the dropdown list, ensuring visibility when opened. - Enhanced the createBranch method in BranchView to automatically select the most recently created branch after a new branch is added, improving user experience.
This commit is contained in:
@@ -98,9 +98,9 @@ export default {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.dropdown-list {
|
.dropdown-list {
|
||||||
position: absolute;
|
/* Statt absolut positioniert (wurde durch übergeordnete Container mit
|
||||||
top: 100%;
|
overflow:hidden abgeschnitten) jetzt im normalen Dokumentfluss, damit
|
||||||
left: 0;
|
die Liste zuverlässig sichtbar ist, sobald isOpen=true. */
|
||||||
background: white;
|
background: white;
|
||||||
border: 1px solid #ccc;
|
border: 1px solid #ccc;
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
|
|||||||
@@ -148,6 +148,17 @@ export default {
|
|||||||
|
|
||||||
async createBranch() {
|
async createBranch() {
|
||||||
await this.loadBranches();
|
await this.loadBranches();
|
||||||
|
// Nach dem Anlegen eines neuen Branches automatisch den
|
||||||
|
// zuletzt/neu erstellten Branch auswählen.
|
||||||
|
if (this.branches.length > 0) {
|
||||||
|
const newest = this.branches.reduce((acc, b) =>
|
||||||
|
!acc || b.id > acc.id ? b : acc,
|
||||||
|
null
|
||||||
|
);
|
||||||
|
if (newest) {
|
||||||
|
await this.onBranchSelected(newest);
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
upgradeBranch() {
|
upgradeBranch() {
|
||||||
|
|||||||
Reference in New Issue
Block a user