Skip to content

Commit

Permalink
fix: ref (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
NateWaldschmidt authored Apr 17, 2024
1 parent 0190220 commit 535d78e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## v2.0.36

- Fix `<TextInput />` ref

## v2.0.35

- Fix helper text styles on `<TextInput />`
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lob/ui-components",
"version": "2.0.35",
"version": "2.0.36",
"engines": {
"node": ">=20.2.0",
"npm": ">=10.2.0"
Expand Down
7 changes: 5 additions & 2 deletions src/components/TextInput/TextInput.vue
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,7 @@ const slots = defineSlots<{
selectedOptions?: () => any;
}>();
const input = ref<HTMLInputElement>();
const showCopied = ref(false);
const hasLeftIcon = computed(() => Boolean(slots.iconLeft));
Expand Down Expand Up @@ -267,7 +268,7 @@ const handleFocus = (e: FocusEvent) => {
const copyToClipboard = () => {
showCopied.value = true;
// this.$refs.input.select();
input.value?.select();
document.execCommand('copy');
emit('copy');
setTimeout(() => {
Expand All @@ -277,7 +278,9 @@ const copyToClipboard = () => {
const clearInput = (e: MouseEvent) => {
e.preventDefault();
// this.$refs.input.value = '';
if (input.value) {
input.value.value = '';
}
modelValue.value = '';
emit('input', '');
emit('change', e);
Expand Down

0 comments on commit 535d78e

Please sign in to comment.