Skip to content

Commit

Permalink
Merge pull request #1155 from Infineon/1152-modal-remove-by-default-f…
Browse files Browse the repository at this point in the history
…ocus

Modal: Removed default focus on buttons
  • Loading branch information
tishoyanchev authored Apr 25, 2024
2 parents 22b606b + 118ee30 commit ef7530f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 6 deletions.
1 change: 0 additions & 1 deletion packages/components/src/components/modal/modal.scss
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
overflow: hidden;
box-sizing: border-box;
align-items: stretch;

}

/* Add desktop size here */
Expand Down
10 changes: 7 additions & 3 deletions packages/components/src/components/modal/modal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,15 @@ export class IfxModal {
duration: 200,
});
anim.addEventListener('finish', () => {
this.attemptFocus(this.getFirstFocusableElement());
// Setting focus on last item and removing immediately
// so, on tab press first element is focused
setTimeout(() => {
this.getLastFocusableElement().focus();
this.getLastFocusableElement().blur();
}, 0);

this.ifxModalOpen.emit();
});
// this.attemptFocus(this.getFirstFocusableElement());
// this.ifxModalOpen.emit();

this.hostElement.addEventListener('keydown', this.handleKeypress);
} catch (err) {
Expand Down
2 changes: 1 addition & 1 deletion packages/components/src/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
</style>

<script defer>

</script>

</head>
Expand Down
3 changes: 2 additions & 1 deletion packages/components/src/stories/foundations/Typography.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,8 @@ Upper and lower casing in English is following the principle sentence case. This

## Typography overview

| token | value | |----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| token | value |
|----------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| <code>$ifxHeadingDisplay01</code> | font-family: Source Sans 3 <br/> font-size: 4.25rem <br/> font-weight: 600 <br/> line-height: 4.75rem <br/> letter-spacing: -0.01em <br/> |
| <code>$ifxHeadingDisplay02</code> | font-family: Source Sans 3 <br/> font-size: 3.5rem <br/> font-weight: 600 <br/> line-height: 4rem <br/> letter-spacing: -0.01em <br/> |
| <code>$ifxHeadingDisplay03</code> | font-family: Source Sans 3 <br/> font-size: 3rem <br/> font-weight: 600 <br/> line-height: 3.75rem <br/> letter-spacing: -0.01em <br/> |
Expand Down

0 comments on commit ef7530f

Please sign in to comment.