Skip to content

Commit

Permalink
Merge pull request #807 from OutSystems/ROU-4510v2
Browse files Browse the repository at this point in the history
ROU-4510: Added alternate fix for the Tabs fix
  • Loading branch information
BenOsodrac authored Aug 30, 2023
2 parents 6092e1b + 939903f commit f729390
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 12 deletions.
3 changes: 0 additions & 3 deletions dist/OutSystemsUI.css
Original file line number Diff line number Diff line change
Expand Up @@ -11714,9 +11714,6 @@ html[data-uieditorversion^="1"] .osui-timepicker__dropdown-ss-preview.time12h, h
-webkit-perspective:1000px;
perspective:1000px;
}
.desktop .osui-tabs__content-item:not(.osui-tabs--is-active) *{
visibility:hidden;
}
.osui-tabs__preview{
display:none;
}
Expand Down
3 changes: 3 additions & 0 deletions dist/OutSystemsUI.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3269,6 +3269,9 @@ declare namespace OSFramework.OSUI.Patterns.Tabs.Enum {
enum ObserverOptions {
RootMargin = "1px"
}
enum ElementsBlockingOnChange {
Dropdown = ".pop-comp-active"
}
enum ChildTypes {
TabsContentItem = "TabsContentItem",
TabsHeaderItem = "TabsHeaderItem"
Expand Down
7 changes: 6 additions & 1 deletion dist/OutSystemsUI.js
Original file line number Diff line number Diff line change
Expand Up @@ -9929,6 +9929,10 @@ var OSFramework;
(function (ObserverOptions) {
ObserverOptions["RootMargin"] = "1px";
})(ObserverOptions = Enum.ObserverOptions || (Enum.ObserverOptions = {}));
let ElementsBlockingOnChange;
(function (ElementsBlockingOnChange) {
ElementsBlockingOnChange["Dropdown"] = ".pop-comp-active";
})(ElementsBlockingOnChange = Enum.ElementsBlockingOnChange || (Enum.ElementsBlockingOnChange = {}));
let ChildTypes;
(function (ChildTypes) {
ChildTypes["TabsContentItem"] = "TabsContentItem";
Expand Down Expand Up @@ -10426,7 +10430,8 @@ var OSFramework;
}
changeTab(tabIndex = this.configs.StartingTab, tabsHeaderItem, triggerEvent = false, triggeredByObserver = false) {
if (this._activeTabHeaderElement === tabsHeaderItem ||
(tabIndex === this.configs.StartingTab && this.isBuilt && tabsHeaderItem === undefined)) {
(tabIndex === this.configs.StartingTab && this.isBuilt && tabsHeaderItem === undefined) ||
this._activeTabContentElement.selfElement.querySelector(Tabs_1.Enum.ElementsBlockingOnChange.Dropdown)) {
return;
}
let newTabIndex;
Expand Down
7 changes: 7 additions & 0 deletions src/scripts/OSFramework/OSUI/Pattern/Tabs/Enum.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,13 @@ namespace OSFramework.OSUI.Patterns.Tabs.Enum {
RootMargin = '1px',
}

/**
* Tabs Enum for Selectors of elements that can block OnChange event
*/
export enum ElementsBlockingOnChange {
Dropdown = '.pop-comp-active',
}

/**
* Tabs Enum for Tabs child types
*/
Expand Down
4 changes: 3 additions & 1 deletion src/scripts/OSFramework/OSUI/Pattern/Tabs/Tabs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1048,7 +1048,9 @@ namespace OSFramework.OSUI.Patterns.Tabs {
if (
this._activeTabHeaderElement === tabsHeaderItem ||
// to prevent triggering event if using client action SetActiveTab to set the already active item
(tabIndex === this.configs.StartingTab && this.isBuilt && tabsHeaderItem === undefined)
(tabIndex === this.configs.StartingTab && this.isBuilt && tabsHeaderItem === undefined) ||
// To prevent changing tab when a dropdown is currently open, which would cause UI issues
this._activeTabContentElement.selfElement.querySelector(Enum.ElementsBlockingOnChange.Dropdown)
) {
return;
}
Expand Down
7 changes: 0 additions & 7 deletions src/scripts/OSFramework/OSUI/Pattern/Tabs/scss/_tabs.scss
Original file line number Diff line number Diff line change
Expand Up @@ -363,13 +363,6 @@
}
}

// Fix issue when patterns like Dropdown are open when the header click is triggered.
.desktop {
.osui-tabs__content-item:not(.osui-tabs--is-active) * {
visibility: hidden;
}
}

// Service Studio Preview Message
.osui-tabs__preview {
display: none;
Expand Down

0 comments on commit f729390

Please sign in to comment.