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

fix(VTextField): reset caret position after input #16759

Merged
merged 2 commits into from
Mar 20, 2023

Conversation

KaelWD
Copy link
Member

@KaelWD KaelWD commented Feb 23, 2023

Description

Fixes #14935

Markup:

<template>
  <v-app>
    <v-container>
      <v-text-field v-model.trim="model" />
    </v-container>
  </v-app>
</template>

<script setup>
  import { computed, ref, watch } from 'vue'

  const model = ref()

  ;(async () => {
    while (true) {
      await new Promise(resolve => setTimeout(resolve, 10))
      for (let i = 0; i++ < 1e8; i << 9 & 9 % 9 * 9 + 9);
    }
  })()
</script>

@KaelWD KaelWD added T: bug Functionality that does not work as intended/expected C: VTextField VTextField labels Feb 23, 2023
@KaelWD KaelWD added this to the v3.1.x milestone Feb 23, 2023
@KaelWD KaelWD self-assigned this Feb 23, 2023
@johnleider
Copy link
Member

johnleider commented Feb 27, 2023

#14935 is a v2 task. Shouldn't this point to #16743 ?

@KaelWD
Copy link
Member Author

KaelWD commented Feb 28, 2023

It exists in v3 too, 16743 is different

@KaelWD
Copy link
Member Author

KaelWD commented Mar 7, 2023

Still need to check if this breaks things on slow devices

@KaelWD KaelWD merged commit 13f9a2b into master Mar 20, 2023
@KaelWD KaelWD deleted the fix/14935-v-model-trim-caret branch March 20, 2023 11:21
@davidstackio
Copy link

davidstackio commented Mar 21, 2023

It looks like this might have broken type="number" input fields:

image

EDIT: FYI I just upgraded to v3.1.11 and is the first time I'm seeing this error.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VTextField VTextField T: bug Functionality that does not work as intended/expected
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug Report][2.6.4] Cursor jumps to the end of textfield if you're using v-model.trim modifier.
3 participants