Skip to content
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

feature: add support for multiple elements highlight #2083

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

IArny
Copy link

@IArny IArny commented Sep 30, 2022

I would propose feature to support multiple elements highlight. All elements selected with attachTo.element will be highlighted if attachTo.multiple is true. I added multiple flag to attachTo field to keep old behavior. I'd appreciate your feedback for this PR.

Also this PR can resolve #525 issue

@Krumil
Copy link

Krumil commented Oct 4, 2022

This will be a life-saver for me! Thanks

@RobbieTheWagner
Copy link
Member

@IArny would you be able to rebase and fix conflicts please? Thanks!

@RobbieTheWagner
Copy link
Member

@IArny I'm so sorry, but it looks like we have conflicts again. Could you rebase one more time please?

@IArny IArny force-pushed the multiple-elements branch 3 times, most recently from a4fe2c0 to ab35a0f Compare January 11, 2023 09:24
@IArny
Copy link
Author

IArny commented Jan 11, 2023

@rwwagner90 I've fixed conflicts and tests, could you check it agait, please

@IArny
Copy link
Author

IArny commented Jan 30, 2023

@rwwagner90 Could you review my PR, please

@IArny
Copy link
Author

IArny commented Feb 10, 2023

Hey, is anyone here? Would appreciate this to be merged to master @rwwagner90

@RobbieTheWagner
Copy link
Member

@IArny apologies, I have not had a chance to review this yet.

@RobbieTheWagner
Copy link
Member

@IArny I finally got a chance to take a look at this. I think it might make more sense to have attachTo be an array of objects with {element, on} like it currently is, just would accept an array instead of just a single element. If we wanted to keep the old API as well, we could use something like isArray to check if the option passed is an array, etc. What do you think?

@IArny
Copy link
Author

IArny commented Feb 26, 2023

@RobbieTheWagner thanks for review, I think that attachTo as an array would be useful feature, but we can leave current implementation as an option too. Maybe you can merge current PR and I will make attachTo as an array in next PR? A bit difficult to support this PR as it contains some linting updates.

@RobbieTheWagner
Copy link
Member

@IArny I don't think we should merge this PR, unfortunately. I think basically we should do:

if(Array.isArray(attachTo) {
  // loop through the attachTo options and do all the attachTo things
} else {
// Just do what we already do when it's a single element
}

I do not like that your implementation requires a root element selector and selects all elements under it when you pass multiple. I would rather be explicit about all the elements you want highlighted.

@juanitoddd
Copy link

juanitoddd commented Aug 23, 2023

This will be much a nice feature !
I guess the Array approach enables the option to place the Pop-up relative to an element but also hightlight another one:

attachTo: [ {element: '.main-highlight', on: 'left'}, {element: '.secondary-highlight'}, ]

@500Foods
Copy link

So it looks like this is almost ready for release? Is that the case?

@davidperezvw
Copy link

Are we gonna see this change on release any soon?

@500Foods
Copy link

Lots of repo activity! Is this in the works now?

@RobbieTheWagner
Copy link
Member

@IArny I don't think we should merge this PR, unfortunately. I think basically we should do:

if(Array.isArray(attachTo) {
  // loop through the attachTo options and do all the attachTo things
} else {
// Just do what we already do when it's a single element
}

I do not like that your implementation requires a root element selector and selects all elements under it when you pass multiple. I would rather be explicit about all the elements you want highlighted.

This was the last place we left off. This is not planned currently, but if someone wanted to spike it out, we would definitely accept PRs!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow highlighting multiple elements per step
6 participants