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

Closing the active tab does not fire events for tab change #7221

Closed
RSantosGIS opened this issue Jun 26, 2023 · 4 comments
Closed

Closing the active tab does not fire events for tab change #7221

RSantosGIS opened this issue Jun 26, 2023 · 4 comments
Assignees
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Knowledge Issues logged by ArcGIS Knowledge team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 5 A few days of work, definitely requires updates to tests. p - high Issue should be addressed in the current milestone, impacts component or core functionality

Comments

@RSantosGIS
Copy link

Actual Behavior

Originally documented in #7155 but broken into a smaller bug report at the request of @mpriour .

When you close the active tab, the active tab automatically changes (as intended) but this does not fire the onCalciteTabsActivate or onCalciteTabChange events for CalciteTabTitle and CalciteTabNav, respectively

Expected Behavior

When you close the active tab and it moves you to a new tab, all of the events for tab navigation should fire.

Reproduction Sample

https://codesandbox.io/s/new-feather-qsyw8j?file=/src/App.js

Reproduction Steps

  1. Open the dev console
  2. Close the active tab - notice the console.log statements don't fire
  3. click to navigate to another tab - notice that the console.log statements do fire

Reproduction Version

1.4.2

Relevant Info

No response

Regression?

No response

Priority impact

p3 - want for upcoming milestone

Impact

This prevents ArcGIS studio from being able to utilize callbacks on tab navigation events reliably. We have to do workarounds where tab closure triggers special handling to also consider navigation, rather than just have navigation events be handled by the actual navigation event handler on the component.

Esri team

ArcGIS Knowledge

@RSantosGIS RSantosGIS added 0 - new New issues that need assignment. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. needs triage Planning workflow - pending design/dev review. labels Jun 26, 2023
@github-actions github-actions bot added ArcGIS Knowledge Issues logged by ArcGIS Knowledge team members. p3 - want for upcoming milestone labels Jun 26, 2023
@geospatialem geospatialem added research Issues that require more in-depth research or multiple team members to resolve or make decision. p - high Issue should be addressed in the current milestone, impacts component or core functionality labels Aug 7, 2023
@geospatialem geospatialem added this to the 2023 August Priorities milestone Aug 7, 2023
@geospatialem geospatialem added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Aug 7, 2023
@geospatialem
Copy link
Member

Research to be conducted in August to determine the time estimate needed for a fix in a future milestone.

@Elijbet
Copy link
Contributor

Elijbet commented Aug 25, 2023

Research to be conducted in August to determine the time estimate needed for a fix in a future milestone.

Research Summary

The question revolves around whether the automatic movement of selection to the next tab after closing one should be considered a user-triggered activation or a programmatic action.

Currently, no TabsActivate or TabChange events, either public or internal, are being fired as part of the closable logic. The suggestion is to emit public events TabsActivate(userTriggered = true / TabChange(userTriggered = true) related to close events based on how the tab was closed (user-triggered vs. programmatic).

Here are some precedent examples where related events are emitted in response to user-initiated actions in other components:

  • pick/value-list emits the remove item event and, after being removed, also emits the list change event.
  • combobox emits filter and combobox change events when the value is cleared (there may be other similar examples).
  • list emits a change event along with its item's select event.

It seems to make sense that emitting associated events should only occur when the user initiates an action that would trigger those events because internal events may not always be necessary; they have been used in specific cases as implementation details.

There was some confusion about the difference between tabActivate and tabChange due to overlap with variable naming across tabs/tab/tab-nav/tab-title. In some cases, calcite-tab refers to both "tab-title with corresponding tab" combo and "tab," depending on the component it's used in. This brought us back to previous discussions on tabs being overly complicated and overdue for restructuring.

Note that non-selected closable tab-title will not fire TabChange or TabActive events since it only affects closure without changing the tab state.

I'll be adding addendum documentation regarding emitting associated events for user-initiated actions in the conventions section under event handling guidelines.

@geospatialem @jcfranco @driskull @macandcheese

@geospatialem geospatialem added estimate - 5 A few days of work, definitely requires updates to tests. needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. 0 - new New issues that need assignment. and removed research Issues that require more in-depth research or multiple team members to resolve or make decision. needs triage Planning workflow - pending design/dev review. 1 - assigned Issues that are assigned to a sprint and a team member. labels Aug 26, 2023
@geospatialem geospatialem removed this from the 2023 August Priorities milestone Aug 26, 2023
@geospatialem geospatialem removed the needs milestone Planning workflow - pending milestone assignment, has priority and/or estimate. label Sep 6, 2023
@jcfranco jcfranco added 1 - assigned Issues that are assigned to a sprint and a team member. and removed 0 - new New issues that need assignment. labels Jan 8, 2024
@jcfranco jcfranco self-assigned this Jan 8, 2024
@jcfranco jcfranco added 2 - in development Issues that are actively being worked on. and removed 1 - assigned Issues that are assigned to a sprint and a team member. labels Jan 10, 2024
jcfranco added a commit that referenced this issue Jan 10, 2024
…after closing the selected tab (#8582)

**Related Issue:** #7221

## Summary

This will help users know when the selected `tab-title` and `tab` have
changed after closing.
@jcfranco jcfranco added 3 - installed Issues that have been merged to master branch and are ready for final confirmation. and removed 2 - in development Issues that are actively being worked on. labels Jan 10, 2024
@github-actions github-actions bot assigned geospatialem and DitwanP and unassigned jcfranco Jan 10, 2024
Copy link
Contributor

Installed and assigned for verification.

@DitwanP
Copy link
Contributor

DitwanP commented Jan 11, 2024

🍠 Verified on 2.2.0-next.17

@DitwanP DitwanP closed this as completed Jan 11, 2024
@DitwanP DitwanP added 4 - verified Issues that have been released and confirmed resolved. and removed 3 - installed Issues that have been merged to master branch and are ready for final confirmation. labels Jan 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - verified Issues that have been released and confirmed resolved. ArcGIS Knowledge Issues logged by ArcGIS Knowledge team members. bug Bug reports for broken functionality. Issues should include a reproduction of the bug. estimate - 5 A few days of work, definitely requires updates to tests. p - high Issue should be addressed in the current milestone, impacts component or core functionality
Projects
None yet
Development

No branches or pull requests

5 participants