Skip to content

Commit 8531754

Browse files
committed
SVY-21251 Bootstrap datalabel onAction does not trigger if entered [ai]
- Added keydown Enter listener in bts_baselabel.ts for non-button elements - Added :focus outline styles for .bts-label and .bts-datalabel in svy_bootstrapcomponents.css
1 parent 0208b60 commit 8531754

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

components/projects/bootstrapcomponents/src/bts_baselabel.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,13 @@ export class ServoyBootstrapBaseLabel<T extends HTMLElement> extends ServoyBoots
2020
svyOnInit() {
2121
super.svyOnInit();
2222
if (this.onActionMethodID()) {
23+
if (this.getFocusElement().tagName !== 'BUTTON') {
24+
this.renderer.listen(this.getFocusElement(), 'keydown', e => {
25+
if (e.key === 'Enter' && this.enabled()) {
26+
this.onActionMethodID()(e, this.getDataTarget(e));
27+
}
28+
});
29+
}
2330
if (this.onDoubleClickMethodID()) {
2431
this.renderer.listen(this.getFocusElement(), 'click', e => {
2532
if(this.enabled()) {

components/projects/bootstrapcomponents/svy_bootstrapcomponents.css

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,11 @@ bootstrapcomponents-textbox {
219219
overflow: hidden;
220220
}
221221

222+
.svy-wrapper > * > .bts-label:focus {
223+
outline-style: solid;
224+
outline-width: 1px;
225+
}
226+
222227
.svy-wrapper > * > .default-align .bts-label-text {
223228
max-height: 100%;
224229
}
@@ -286,6 +291,11 @@ ngb-typeahead-window.dropdown-menu {
286291
display: block;
287292
}
288293

294+
.svy-wrapper > * > .bts-datalabel:focus {
295+
outline-style: solid;
296+
outline-width: 1px;
297+
}
298+
289299
.svy-wrapper > * > .bts-datalabel.default-align {
290300
display: flex;
291301
align-items: center;

0 commit comments

Comments
 (0)