-
Notifications
You must be signed in to change notification settings - Fork 2
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
chore: MapAndLabel
tidy ups
#3643
Conversation
Removed vultr server and associated DNS entries |
// Set active index as highest tab after removal, so that when you "add" a new feature the tabs increment correctly | ||
setActiveIndex((features && features.length - 2) || activeIndex - 1); | ||
setActiveIndex((features && features.length - 2) || 0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If this is - 1
rather than - 2
, then there's a known bug:
- Add three features
- Remove feature 3 - active tab is tab 2
- Remove feature 2 - active tab is NOT tab 1 as expected
One to keep thinking on, still not completely satisfied with this solution !
}; | ||
|
||
const addInitialFeaturesToMap = (features: Feature[]) => { | ||
setFeatures(features); | ||
// TODO: setActiveIndex ? | ||
// setActiveIndex(features.length - 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like the right solution to me, and it does indeed mean the latest tab will be active/open when coming "back", but it unexpectedly make all other tabs un-clickable - so noted in PR description as outstanding bug
A few tidy ups & fixes now that all major functionality is merged & open for testing ! Follows on from #3625
Fixes here:
properties
require labels to be stored as strings, but we want to sort them as numbersactiveTabIndex
more consistently managed based on length offeatures
when adding & removing featuresKnown still-outstanding bugs, to address in followup PRs:
features
array)