@saasmakers/ui 2.0.41 → 2.0.42

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -181,6 +181,7 @@ defineExpose({
181
181
  :id="id"
182
182
  ref="input"
183
183
  :autocomplete="autocomplete ? 'on' : 'off'"
184
+ v-bind="autofocus ? { 'data-autofocus': '' } : {}"
184
185
  class="h-full w-full appearance-none items-center rounded-lg font-medium tracking-tight outline-none placeholder-gray-600 dark:placeholder-gray-400"
185
186
  :class="{
186
187
  'uppercase': uppercase,
@@ -75,8 +75,12 @@ export default function useDialog(
75
75
 
76
76
  if (panelRef.value) {
77
77
  const focusableElements = getFocusableElements(panelRef.value)
78
+ const autofocusTarget = panelRef.value.querySelector<HTMLElement>('[data-autofocus]')
78
79
 
79
- if (focusableElements.length > 0) {
80
+ if (autofocusTarget) {
81
+ autofocusTarget.focus()
82
+ }
83
+ else if (focusableElements.length > 0) {
80
84
  focusableElements[0].focus()
81
85
  }
82
86
  else {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@saasmakers/ui",
3
- "version": "2.0.41",
3
+ "version": "2.0.42",
4
4
  "private": false,
5
5
  "description": "Reusable Nuxt UI components for SaaS Makers projects",
6
6
  "license": "MIT",