Closed itsamrit closed 1 year ago
Thanks for the PR! The code right now feels a bit redundant. Can't you just subtract one from endIndex if the user is trying to remove all the colours?
Okay
I have made the changes. Please look at it. If there any problem from my side, please tell me. I'll make sure to fix it.
Hey, thanks for the attempt. I may not have properly explained myself, what I meant is, if the user is trying to delete all the colours, delete ALL of them except the last one. To do so, it's probably enough to keep the old code, check when the user is trying to delete all the colours and decrease endIndex by 1.
If we just check, if user is trying to remove all colors then endIndex minus 1. Then there will be bug left : eg: if there is 4 colors in palette & user selects all colors to remove then endIndex comes to 2nd index from 3rd index by minus 1 ,but if user clicks 'remove' again without selecting anything then startIndex is still on 0th index & endIndex is at 2nd which causes removal of all colors from palette. To fix this i have used condition : if(coloursList.childElementCount == 1) return;
Looking perfect, I'm merging this! Thanks 👍
Thanks 👍👍
✅ Deploy Preview for competent-tesla-4b5f1e ready!
Toggle QR Code...
Use your smartphone camera to open QR code link.
To edit notification comments on pull requests, go to your Netlify site settings.