-
Notifications
You must be signed in to change notification settings - Fork 159
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
Fix-248-Copy-button-issue #565
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -24,7 +24,7 @@ | |||||
}; | ||||||
</script> | ||||||
|
||||||
<div> | ||||||
<div id="tooltip-container"> | ||||||
<label class:u-hide={!showLabel} class="label" for={label}>{label}</label> | ||||||
<div class="input-text-wrapper" style="--amount-of-buttons:1"> | ||||||
<input {value} id={label} type="text" class="input-text" readonly /> | ||||||
|
@@ -37,7 +37,8 @@ | |||||
on:mouseenter={() => setTimeout(() => (content = 'Click to copy'))} | ||||||
use:tooltip={{ | ||||||
content, | ||||||
hideOnClick: false | ||||||
hideOnClick: false, | ||||||
appendTo: document.getElementById('tooltip-container') | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice find! I do think this is on the right track. Looking at the documentation, appendTo can be a function that takes a reference to the element itself, so we can change this to:
Suggested change
Be sure to add a comment or commit message to explain why we need to do |
||||||
}}> | ||||||
<span class="icon-duplicate" aria-hidden="true" /> | ||||||
</button> | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's best to avoid IDs when possible since they're highly selective regarding CSS, and IDs should be unique, but this component can be used multiple times/places. For example,
console/src/routes/console/project-[project]/settings/updateName.svelte
Lines 48 to 49 in ffb7476