diff --git a/resources/js/Pages/Teams/Partials/OrganizationBillableRate.vue b/resources/js/Pages/Teams/Partials/OrganizationBillableRate.vue
index 03f42cc7..460319dc 100644
--- a/resources/js/Pages/Teams/Partials/OrganizationBillableRate.vue
+++ b/resources/js/Pages/Teams/Partials/OrganizationBillableRate.vue
@@ -71,6 +71,7 @@ function checkForConfirmationModal() {
diff --git a/resources/js/packages/ui/src/Input/DatePicker.vue b/resources/js/packages/ui/src/Input/DatePicker.vue
index 69d5c4a2..f7af1d1b 100644
--- a/resources/js/packages/ui/src/Input/DatePicker.vue
+++ b/resources/js/packages/ui/src/Input/DatePicker.vue
@@ -54,7 +54,7 @@ const emit = defineEmits(['changed']);
@keydown.enter="updateDate"
:class="
twMerge(
- 'bg-input-background border text-white border-input-border focus-visible:outline-0 focus-visible:ring-0 rounded-md',
+ 'bg-input-background border text-white border-input-border focus-visible:outline-0 focus-visible:border-input-border-active focus-visible:ring-0 rounded-md',
props.class
)
"
diff --git a/resources/js/packages/ui/src/Input/Dropdown.vue b/resources/js/packages/ui/src/Input/Dropdown.vue
index 3d1b468a..827b8776 100644
--- a/resources/js/packages/ui/src/Input/Dropdown.vue
+++ b/resources/js/packages/ui/src/Input/Dropdown.vue
@@ -1,5 +1,5 @@
-
diff --git a/resources/js/packages/ui/src/Input/SelectDropdown.vue b/resources/js/packages/ui/src/Input/SelectDropdown.vue
index 7ad99f3b..70df41dd 100644
--- a/resources/js/packages/ui/src/Input/SelectDropdown.vue
+++ b/resources/js/packages/ui/src/Input/SelectDropdown.vue
@@ -5,7 +5,6 @@ import SelectDropdownItem from '@/packages/ui/src/Input/SelectDropdownItem.vue';
import { onKeyStroke } from '@vueuse/core';
import { type Placement } from '@floating-ui/vue';
import { twMerge } from 'tailwind-merge';
-
const model = defineModel
({
default: null,
});
@@ -41,12 +40,36 @@ const filteredItems = computed(() => {
});
});
+const highlightedItemId = ref(model.value);
+
+watch(model, () => {
+ highlightedItemId.value = model.value;
+});
+
watch(filteredItems, () => {
- if (filteredItems.value.length > 0) {
+ if (
+ filteredItems.value.length > 0 &&
+ filteredItems.value.find(
+ (item) => props.getKeyFromItem(item) === highlightedItemId.value
+ ) === undefined
+ ) {
highlightedItemId.value = props.getKeyFromItem(filteredItems.value[0]);
}
});
+watch(highlightedItemId, () => {
+ if (highlightedItemId.value) {
+ const highlightedDomElement = dropdownViewport.value?.querySelector(
+ `[data-select-id="${highlightedItemId.value}"]`
+ ) as HTMLElement;
+
+ highlightedDomElement?.scrollIntoView({
+ block: 'nearest',
+ inline: 'nearest',
+ });
+ }
+});
+
const emit = defineEmits(['update:modelValue', 'changed']);
function setItem(newValue: string | null) {
@@ -89,7 +112,6 @@ function moveHighlightDown() {
}
}
-const highlightedItemId = ref(model.value);
const highlightedItem = computed(() => {
return props.items.find(
(item) => props.getKeyFromItem(item) === highlightedItemId.value
@@ -120,20 +142,16 @@ onKeyStroke('Enter', (e) => {
watch(open, () => {
if (open.value === true) {
nextTick(() => {
- scrollCurrentItemInView();
+ const highlightedDomElement = dropdownViewport.value?.querySelector(
+ `[data-select-id="${model.value}"]`
+ ) as HTMLElement;
+ dropdownViewport.value?.scrollTo({
+ top: highlightedDomElement?.offsetTop ?? 0,
+ behavior: 'instant',
+ });
});
}
});
-
-function scrollCurrentItemInView() {
- const highlightedDomElement = dropdownViewport.value?.querySelector(
- `[data-select-id="${model.value}"]`
- ) as HTMLElement;
- dropdownViewport.value?.scrollTo({
- top: highlightedDomElement?.offsetTop ?? 0,
- behavior: 'instant',
- });
-}
@@ -145,7 +163,10 @@ function scrollCurrentItemInView() {
diff --git a/resources/js/packages/ui/src/Input/SelectDropdownItem.vue b/resources/js/packages/ui/src/Input/SelectDropdownItem.vue
index ef930f31..77b37790 100644
--- a/resources/js/packages/ui/src/Input/SelectDropdownItem.vue
+++ b/resources/js/packages/ui/src/Input/SelectDropdownItem.vue
@@ -4,20 +4,24 @@ import { twMerge } from 'tailwind-merge';
const props = defineProps<{
name: string;
selected: boolean;
+ highlighted: boolean;
}>();
-
-
{{ name }}
+
diff --git a/resources/js/packages/ui/src/Input/TextInput.vue b/resources/js/packages/ui/src/Input/TextInput.vue
index c8f08554..f29d9f1b 100644
--- a/resources/js/packages/ui/src/Input/TextInput.vue
+++ b/resources/js/packages/ui/src/Input/TextInput.vue
@@ -1,8 +1,10 @@