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

Improve Combobox input cursor position #1574

Merged
merged 2 commits into from Jun 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/@headlessui-react/CHANGELOG.md
Expand Up @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Fix incorrect transitionend/transitioncancel events for the Transition component ([#1537](https://github.com/tailwindlabs/headlessui/pull/1537))
- Improve outside click of `Dialog` component ([#1546](https://github.com/tailwindlabs/headlessui/pull/1546))
- Detect outside clicks from within `<iframe>` elements ([#1552](https://github.com/tailwindlabs/headlessui/pull/1552))
- Improve Combobox input cursor position ([#1574](https://github.com/tailwindlabs/headlessui/pull/1574))

## [1.6.4] - 2022-05-29

Expand Down
Expand Up @@ -1064,7 +1064,7 @@ let Option = forwardRefWithAs(function Option<
select()
if (data.mode === ValueMode.Single) {
actions.closeCombobox()
disposables().nextFrame(() => data.inputRef.current?.focus({ preventScroll: true }))
data.inputRef.current?.focus({ preventScroll: true })
}
})

Expand Down
1 change: 1 addition & 0 deletions packages/@headlessui-vue/CHANGELOG.md
Expand Up @@ -18,6 +18,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Improve outside click of `Dialog` component ([#1546](https://github.com/tailwindlabs/headlessui/pull/1546))
- Detect outside clicks from within `<iframe>` elements ([#1552](https://github.com/tailwindlabs/headlessui/pull/1552))
- Only render the `Dialog` on the client ([#1566](https://github.com/tailwindlabs/headlessui/pull/1566))
- Improve Combobox input cursor position ([#1574](https://github.com/tailwindlabs/headlessui/pull/1574))

## [1.6.4] - 2022-05-29

Expand Down
Expand Up @@ -892,7 +892,7 @@ export let ComboboxOption = defineComponent({
api.selectOption(id)
if (api.mode.value === ValueMode.Single) {
api.closeCombobox()
nextTick(() => dom(api.inputRef)?.focus({ preventScroll: true }))
dom(api.inputRef)?.focus({ preventScroll: true })
}
}

Expand Down