Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ROU-11295: Fix Tabs issue where getting focused while entering the screen #998

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/validate-pr-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ on:

jobs:
check-label:
uses: OutSystems/rd.github-reusable-workflows/.github/workflows/[email protected].4
uses: OutSystems/rd.github-reusable-workflows/.github/workflows/[email protected].5
2 changes: 1 addition & 1 deletion .github/workflows/validate-pr-title.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ on:

jobs:
build:
uses: OutSystems/rd.github-reusable-workflows/.github/workflows/[email protected].4
uses: OutSystems/rd.github-reusable-workflows/.github/workflows/[email protected].5
with:
validate-semVer: false
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,6 @@
"typedoc-plugin-merge-modules": "^4.0.1",
"typedoc-umlclass": "^0.7.0",
"typescript": "^4.5.0",
"virtual-select-plugin": "^1.0.45"
"virtual-select-plugin": "^1.0.46"
gnbm marked this conversation as resolved.
Show resolved Hide resolved
}
}
4 changes: 2 additions & 2 deletions src/scripts/OSFramework/OSUI/Helper/Dates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ namespace OSFramework.OSUI.Helper {
// Check if the given date is not a date object and if it's a valid date
if (typeof date === 'string') {
// Check if string could be parsed into a date - If it has an expected dateformat
if (isNaN(Date.parse(date))) {
if (Number.isNaN(Date.parse(date))) {
throw new Error(`The given date '${date}' it's not a valid date.`);
}
_date = new Date(Date.parse(date));
Expand Down Expand Up @@ -80,7 +80,7 @@ namespace OSFramework.OSUI.Helper {
* @memberof Dates
*/
public static IsValid(date: string): boolean {
return !isNaN(Number(this.NormalizeDate(date)));
return !Number.isNaN(Number(this.NormalizeDate(date)));
}

/**
Expand Down
2 changes: 1 addition & 1 deletion src/scripts/OSFramework/OSUI/Helper/Times.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ namespace OSFramework.OSUI.Helper {
* @memberof OSFramework.Helper.Times
*/
public static IsNull(time: string): boolean {
if (isNaN(Date.parse(time))) {
if (Number.isNaN(Date.parse(time))) {
// Check if the given time is not a time object and if it's a valid time
if (typeof time === Constants.JavaScriptTypes.String) {
const isValid = /^([0-1]?[0-9]|2[0-4]):([0-5][0-9])(:[0-5][0-9])?$/.test(time);
Expand Down
6 changes: 4 additions & 2 deletions src/scripts/OSFramework/OSUI/Pattern/Tabs/Tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@ namespace OSFramework.OSUI.Patterns.Tabs {
this._activeTabContentElement = newContentItem;
}

if (this._hasDragGestures) {
// Set focus on the new active header element when running on a device with drag gestures
// and the tabs are built to make sure if only runs after the tabs are built
if (this._hasDragGestures && this.isBuilt) {
this._activeTabHeaderElement.setFocus();
}

Expand Down Expand Up @@ -397,7 +399,7 @@ namespace OSFramework.OSUI.Patterns.Tabs {

// If at this moment the active item has no size (NaN), set an observer to run this method when its size is changed
// This happens, as an example, when there're tabs inside tabs, and inner one has no size when it's built, due to being on a non-active tab
if (isNaN(_finalSize) || _finalSize === 0) {
if (Number.isNaN(_finalSize) || _finalSize === 0) {
const resizeObserver = new ResizeObserver((entries) => {
for (const entry of entries) {
if (entry.contentBoxSize) {
Expand Down
Loading