Fleet Target Clusters assign focus on add MatchExpression rule

Signed-off-by: Francesco Torchia <francesco.torchia@suse.com>
This commit is contained in:
Francesco Torchia 2025-07-01 16:46:25 +02:00
parent 7d30fa86a7
commit a7db4d17dd
No known key found for this signature in database
GPG Key ID: E6D011B7415D4393
1 changed files with 9 additions and 3 deletions

View File

@ -8,7 +8,7 @@ import { convert, simplify } from '@shell/utils/selector';
import LabeledSelect from '@shell/components/form/LabeledSelect';
export default {
emits: ['update:value', 'remove'],
emits: ['update:value', 'add', 'remove'],
components: { Select, LabeledSelect },
props: {
@ -236,6 +236,12 @@ export default {
}
this.rules.push(newRule);
this.$nextTick(() => {
this.focus(this.rules.length - 1);
this.$emit('add');
});
},
update() {
@ -271,8 +277,8 @@ export default {
});
},
focus() {
this.$refs['input-match-expression-key-0']?.[0]?.focus();
focus(index = 0) {
this.$refs[`input-match-expression-key-${ index }`]?.[0]?.focus();
}
}
};