Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

add event click on wrapper #26

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

dawidmachon
Copy link

Hi! 👋

Firstly, thanks for your work on this project! 🙂

Today I used patch-package to patch svelte-avatar@1.1.1 for the project I'm working on.

Very often work for avatar is option to be clickable. With this small addition, I don't need anymore, use my own wrapper around your wrapper. It's also not mandatory, so forwarding the event to it is optional.

Here is the diff that solved my problem:

@@ -71,7 +71,7 @@
   }
 </style>
 
-<div
+<div on:click
   aria-label={name}
   class="wrapper"
   style="{style}--borderRadius:{square ? 0 : borderRadius}; --size:{size}; --bgColor:{background};

This issue body was partially generated by patch-package.

Hi! 👋 
      
Firstly, thanks for your work on this project! 🙂

Today I used [patch-package](https://github.com/ds300/patch-package) to patch `svelte-avatar@1.1.1` for the project I'm working on.

Very often work for avatar is option to be clickable. With this small addition, I don't need anymore, use my own wrapper around your wrapper. It's also not mandatory, so forwarding the event to it is optional.

Here is the diff that solved my problem:

```diff
diff --git a/node_modules/svelte-avatar/src/Avatar.svelte b/node_modules/svelte-avatar/src/Avatar.svelte
index e057984..96fd965 100644
--- a/node_modules/svelte-avatar/src/Avatar.svelte
+++ b/node_modules/svelte-avatar/src/Avatar.svelte
@@ -71,7 +71,7 @@
   }
 </style>
 
-<div
+<div on:click
   aria-label={name}
   class="wrapper"
   style="{style}--borderRadius:{square ? 0 : borderRadius}; --size:{size}; --bgColor:{background};
```

<em>This issue body was [partially generated by patch-package](https://github.com/ds300/patch-package/issues/296).</em>
@wdtamagi
Copy link
Owner

Hi @dawidmachon,
Thank you so much for your contribution, just give me a time for check somethings and I will back to you.

@wdtamagi
Copy link
Owner

wdtamagi commented Oct 2, 2022

@dawidmachon The main idea was to who uses the avatar can use the own wrapper with all properties needed, do you think that it makes sense?

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

Successfully merging this pull request may close these issues.

2 participants