Param302 / SocialRepo

Social Repo - Your Social Handles Repository in a chrome extension.
Apache License 2.0
36 stars 34 forks source link

[FEATURE] Implement Auto remove Link Box on Focus Out #53

Closed Param302 closed 4 months ago

Param302 commented 4 months ago

Implement Auto remove Link Container on Focus Out

Overview

Implement a function in JS which auto-removes the .link-box if it is out of focus and it's child input element is empty in Edit panel.

image

In above image, we can see there are 4 .link-box elements. 2nd is in focus, 4th is out of focus, but it's input is not empty. 1st and 3rd are out of focus and their child input element is empty. So, we have to implement a JS function such that it removes 1st and 3rd type of .link-box elements.

Requirements

Structure

If you have any suggestion or idea, you're welcome to share.

Let's implement SocialRepo's auto-remove link container feature! 🙌

DevvMaurya commented 4 months ago

whenever i add something and try to add new box all the previous data gone..! Is this happens only with me.?

solution of First case:

// if the input field is empty, remove the child box inputField.addEventListener('focusout',()=>{ if(inputField.value === ""){ childFocus.remove(); } }); @Param302 without saving data we couldn't implement 2nd case.

Param302 commented 4 months ago

whenever i add something and try to add new box all the previous data gone..! Is this happens only with me.?

solution of First case:

// if the input field is empty, remove the child box inputField.addEventListener('focusout',()=>{ if(inputField.value === ""){ childFocus.remove(); } }); @Param302 without saving data we couldn't implement 2nd case.

Oky I guess you are working on this issue, I am assigning you this issue. And while the extension is open the data isn't lost, maybe there's some glitch in yours, can you share a video of exactly what is happening?

DevvMaurya commented 4 months ago

https://github.com/Param302/SocialRepo/assets/105772302/c14c8e09-5f06-4908-a356-b5828bd9220c

@Param302 see i'm adding links in fields and when try to add new box . data is gone.

DevvMaurya commented 4 months ago

https://github.com/Param302/SocialRepo/assets/105772302/4c434d0d-7849-4d72-99eb-b3ba44c0c6e7

@Param302 check this case2:

Param302 commented 4 months ago

Media2.mp4

@Param302 check this case2:

Cool! Case 2 is working fine!

Param302 commented 4 months ago

Media1.mp4

@Param302 see i'm adding links in fields and when try to add new box . data is gone.

Regarding this issue, there's a bug in code i guess, also we haven't used storage as of now, so this will be fixed in future. Thanks for pointing it out @DevvMaurya

DevvMaurya commented 4 months ago

Okay Got it..👍 did you review solution of both cases? Should I generate PR? @Param302

Param302 commented 4 months ago

Okay Got it..👍 did you review solution of both cases? Should I generate PR? @Param302

1st one is not cleared, make the PR, i will review it.

DevvMaurya commented 4 months ago

PR is made. Review it.👍

If you find it help full. I have request to you that please mention me on linkedin so that I can show recruiters about my open source contribution. if don't want to do this i'm not forcing you.