Bugfix/13911 order edit duplicate tabs #3330
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
On the order edit page, we’re getting both dynamic and static versions of the edit form. Each version pulls in the content tabs, so they’re essentially duplicated.
Issue 1: both static and dynamic tabs were taken into account when calculating if the tabs dropdown should be shown.
Fixed by re-initialising tabs after
OrderActions
had a chance to add ahidden
class to the ones that should be hidden.Issue 2: all tabs (for the static and dynamic forms) were showing in the tabs dropdown (looks like this existed in v3, too). Fixed by programmatically showing/hiding dropdown tab links depending on whether the order is being edited or not.
Issue 3 (raised by Nathaniel): when in editing mode, the “Transactions” tab was still selectable from the dropdown. Fixed by making it appear disabled, preventing pointer events and then falling back on selecting the previously selected tab if a user still somehow managed to select the “Transactions” tab from the dropdown.
All of the above is complemented by a CMS PR (craftcms/cms#13926) that skips moving focus to disabled options when navigating via keyboard.
Related issues
craftcms/cms#13911