Skip to content

Commit 85bb4d4

Browse files
Garfield-frjma
andcommitted
fix(editor): submit on enter key
* Closes rero/rero-ils#3939. Co-Authored-by: Bertrand Zuchuat <bertrand.zuchuat@rero.ch> Co-Authored-by: Johnny Mariethoz <johnny.mariethoz@rero.ch>
1 parent 616c628 commit 85bb4d4

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

projects/rero/ng-core/src/lib/record/editor/editor.component.html

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,20 @@
4646
(onClick)="cancel()"
4747
/>
4848
<!-- save button -->
49-
@if (saveAlternatives.length === 0) {
50-
<p-button
49+
<!--
50+
TODO: Fix this when the split-button component allows you to change the button type.
51+
We hide the submit button when the split button is displayed so that the submit function
52+
can still be accessed using the enter key.
53+
-->
54+
<p-button
55+
type="submit"
5156
id="editor-save-button"
5257
[label]="'Save' | translate"
53-
(onClick)="submit()"
5458
[disabled]="isSaveButtonDisabled"
59+
[hidden]="saveAlternatives.length > 0"
5560
/>
56-
} @else {
61+
<!-- END TODO -->
62+
@if (saveAlternatives.length > 0) {
5763
<p-splitButton
5864
id="editor-save-button-split"
5965
[label]="'Save' | translate"

0 commit comments

Comments
 (0)