Vuetify Version: 2.1.14
Vue Version: 2.6.11
Browsers: Chrome 78.0.3904.108
OS: Windows 10
Use fab prop on v-btn component and click it.
It should not retain focus on click just like other v-btn types.
Also setting property retain-focus-on-click="false" doesn't work.
It retains focus after click.
https://codepen.io/milost1982/pen/YzPGQpb?&editable=true&editors=101
Isn't it intended?
https://github.com/vuetifyjs/vuetify/blob/v2.2.0-beta.0/packages/vuetify/src/components/VBtn/VBtn.ts
click (e: MouseEvent): void {
!this.retainFocusOnClick && !this.fab && e.detail && this.$el.blur()
this.$emit('click', e)
this.btnToggle && this.toggle()
},
This is not a bug.
If you have any additional questions, please reach out to us in our Discord community.
I tried asking on discord but didn't get the answer, so I will ask here:
Does "retain-focus-on-click" prop works on "fab" buttons?
If I set: retain-focus-on-click="false" nothing seems to change and focus is still retained after click.
Dear @johnleider
I have exactly same issue, this is my button:
<v-btn
color="secondary"
:style="{'z-index': '10000', left: '50%', bottom: '-25px', transform:'translateX(-50%)'}"
dark
absolute
fab
retain-focus-on-click
@click="onAddCartItem">
<v-icon>mdi-plus</v-icon>
</v-btn>
Once clicked on button it stay focused.
Dear @johnleider
I have exactly same issue, this is my button:
<v-btn color="secondary" :style="{'z-index': '10000', left: '50%', bottom: '-25px', transform:'translateX(-50%)'}" dark absolute fab **retain-focus-on-click** @click="onAddCartItem"> <v-icon>mdi-plus</v-icon> </v-btn>Once clicked on button it stay focused.
you have the flag retain-focus-on-click
Youre telling the button to retain it = keep focus
I have the same problem.
NOT a fab button, but focus gets retained and i set
:retain-focus-on-click="false"
just to make sure.
Same as @milost1982 I have a fab button that is still retaining focus after click, even if explicitly putting :retain-focus-on-click="false".
Most helpful comment
I tried asking on discord but didn't get the answer, so I will ask here:
Does "retain-focus-on-click" prop works on "fab" buttons?
If I set: retain-focus-on-click="false" nothing seems to change and focus is still retained after click.