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

Components mis-rendered after value changed by Vue #194

Closed
FirokOtaku opened this issue Jul 28, 2023 · 1 comment
Closed

Components mis-rendered after value changed by Vue #194

FirokOtaku opened this issue Jul 28, 2023 · 1 comment
Assignees
Labels
bug Something isn't working next release Available in the next release

Comments

@FirokOtaku
Copy link
Contributor

Example Code

<template>
<div class="row">
    <label class="slider large min">
        <input type="range" v-model.number="number" min="0" max="10" step="1" id="slider-number">
        <span></span>
    </label>
    <div class="field border small min">
        <input type="number" style="width: 70px" v-model.number="number" min="0" max="10" step="1" id="input-number"/>
    </div>
</div>
</template>
<script>
import { ref } from 'vue'
const number = ref(5)
</script>

image

If we change number value via operating #input-number component or number.value = xxx, #slider-number would be mis-rendered.

image

image

Only after we operate #slider-number that bar can be refreshed and rendered correctly.

Enviroment

  • Vue3 ^3.3.4
  • Beer.css ^3.2.13
  • Chrome 114
@FirokOtaku
Copy link
Contributor Author

Also this kind of mis-render problem happens in some other components. Vue often does not trigger style update of them.

For example, label position of <input type="text"/> would not reset after clearing component value.

<template>
<div class="row">
  <div class="field label border small">
    <input type="text" v-model="text" id="input-text">
    <label>Label</label>
  </div>

  <div>
    <button @click="text = ''">reset</button>
  </div>
</div>
</template>
<script>
import { ref } from 'vue'
const text = ref('123')
</script>

image

After clicking reset button:

image

After click #input-text and release focus:

image

@FirokOtaku FirokOtaku changed the title Slider mis-rendered after value changed by Vue Components mis-rendered after value changed by Vue Jul 28, 2023
@leonardorafael leonardorafael self-assigned this Jul 31, 2023
@leonardorafael leonardorafael added bug Something isn't working next release Available in the next release labels Jul 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working next release Available in the next release
Projects
None yet
Development

No branches or pull requests

2 participants