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

Task selected class #24

Closed
ghost opened this issue Jan 31, 2021 · 5 comments
Closed

Task selected class #24

ghost opened this issue Jan 31, 2021 · 5 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@ghost
Copy link

ghost commented Jan 31, 2021

Whenever a task is clicked on or dragged/moved, the following CSS class always stays: .sg-task.selected.svelte-19txnoa. It would be good if and when the user clicks out somewhere else on the page (not necessarily on another task - anywhere on the page really), for the selected class to be removed from the task. I think this may require some event listener (but not exactly sure).

@ANovokmet ANovokmet added enhancement New feature or request good first issue Good for newcomers labels Feb 2, 2021
@ANovokmet
Copy link
Owner

ANovokmet commented Feb 2, 2021

Thanks for reporting this issue. You're right. There's an exposed method selectTask(id) but there is no method that allows you to unselect a task. For outside click, we need to add an event listener to document.body and check if the click falls inside a task.

ANovokmet added a commit that referenced this issue Feb 2, 2021
@ghost
Copy link
Author

ghost commented Feb 2, 2021

Can you show an example please where clicking out of the task unselects it please?

@ANovokmet
Copy link
Owner

I've decided to hold on to that feature because it's more complex to do effectively. For now, you can make the handler yourself and use gantt.unselectTasks() to deselect them.

@ghost
Copy link
Author

ghost commented Feb 2, 2021

@ANovokmet Okay, thanks. For all these issues you are fixing, how do I get these updates like for the sticky option? Do you need to publish them to npm and bump the version number?

@ANovokmet
Copy link
Owner

@darekeapp Yeah, pretty much. Going to do it tommorrow. You can always pull the repo and build it yourself, or download https://github.com/ANovokmet/svelte-gantt/tree/master/docs/dist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant