Skip to content

Commit

Permalink
fix(button): vertical align + test disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
aesteves60 authored and dpellier committed Aug 31, 2023
1 parent b53033f commit 268eeb2
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class OdsButtonController {
* Checking if the button is in a form to add the form submit behaviour on it
*/
private submitForm(event: MouseEvent | KeyboardEvent) {
if (this.component.type && this.component.type === "submit") {
if (this.component.type && this.component.type === "submit" && !this.component.disabled) {
const form = (event.target as HTMLElement).closest("form");
if (form) {
event.preventDefault();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@
}

.button__centered-text {
min-width: 0;
grid-area: center;
min-width: 0;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
word-break: break-all;
--ods-icon-vertical-align: bottom;
}
}

Expand Down Expand Up @@ -114,10 +116,6 @@ slot {
display: none;
}

.button__centered-text {
grid-area: center;
}

// apply the theme template for the component
@include ods-theme-component() {
@include osds-button-theme-color();
Expand Down
22 changes: 22 additions & 0 deletions packages-new/components/button/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,18 @@
<osds-button>Default</osds-button>
<osds-button size='lg'>Large</osds-button>

<p>Vertical Align</p>
<osds-button>
<span slot="start"><osds-icon name="close" contrasted="" size="sm" aria-hidden="" alt="" aria-name="" color="default" class="hydrated"></osds-icon><!----></span>
<osds-icon name="close" contrasted="" size="sm" aria-hidden="" alt="" aria-name="" color="default" class="hydrated"></osds-icon>
<span slot="end"><osds-icon name="close" contrasted="" size="sm" aria-hidden="" alt="" aria-name="" color="default" class="hydrated"></osds-icon><!----></span>
</osds-button>
<osds-button inline>
<span slot="start"><osds-icon name="close" contrasted="" size="sm" aria-hidden="" alt="" aria-name="" color="default" class="hydrated"></osds-icon><!----></span>
<osds-icon name="close" contrasted="" size="sm" aria-hidden="" alt="" aria-name="" color="default" class="hydrated"></osds-icon>
<span slot="end"><osds-icon name="close" contrasted="" size="sm" aria-hidden="" alt="" aria-name="" color="default" class="hydrated"></osds-icon><!----></span>
</osds-button>

<p>Variant</p>
<osds-button variant='ghost'>Ghost</osds-button>
<osds-button variant='stroked'>Primary</osds-button>
Expand Down Expand Up @@ -95,6 +107,16 @@
<p>Inline</p>
<osds-button inline>Default</osds-button>

<p>InlineWith Icon</p>
<osds-button inline>
Default
<osds-icon
name="plus"
size="sm"
color="primary"
/>
</osds-button>

<p>Ellipsis</p>
<osds-button size='lg'>
<span slot='start'>start</span>
Expand Down

0 comments on commit 268eeb2

Please sign in to comment.