Skip to content

Commit

Permalink
Fix: 28988 parent for subcategories can be selected with arrow keys
Browse files Browse the repository at this point in the history
  • Loading branch information
tienifr committed Oct 9, 2023
1 parent 4a24fd6 commit 878f84e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/components/CategoryPicker/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ function CategoryPicker({selectedCategory, policyCategories, policyRecentlyUsedC
}, [selectedCategory]);

const sections = useMemo(() => {
const validPolicyRecentlyUsedCategories = _.filter(policyRecentlyUsedCategories, (p) => !_.isEmpty(p));
const {categoryOptions} = OptionsListUtils.getFilteredOptions(
{},
{},
Expand All @@ -43,7 +44,7 @@ function CategoryPicker({selectedCategory, policyCategories, policyRecentlyUsedC
false,
true,
policyCategories,
policyRecentlyUsedCategories,
validPolicyRecentlyUsedCategories,
false,
);

Expand Down
5 changes: 4 additions & 1 deletion src/libs/actions/IOU.js
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,10 @@ function getMoneyRequestInformation(
// For now it only uses the first tag of the policy, since multi-tags are not yet supported
const tagListKey = _.first(_.keys(policyTags));
const uniquePolicyRecentlyUsedTags = recentlyUsedPolicyTags ? _.filter(recentlyUsedPolicyTags[tagListKey], (recentlyUsedPolicyTag) => recentlyUsedPolicyTag !== tag) : [];
optimisticPolicyRecentlyUsedTags[tagListKey] = [tag, ...uniquePolicyRecentlyUsedTags];
if (tag) {
uniquePolicyRecentlyUsedTags.unshift(tag);
}
optimisticPolicyRecentlyUsedTags[tagListKey] = [...uniquePolicyRecentlyUsedTags];
}

// If there is an existing transaction (which is the case for distance requests), then the data from the existing transaction
Expand Down

0 comments on commit 878f84e

Please sign in to comment.