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

[Feature Request] V-expansion-panels icon position #9698

Closed
beerwin opened this issue Nov 15, 2019 · 9 comments
Closed

[Feature Request] V-expansion-panels icon position #9698

beerwin opened this issue Nov 15, 2019 · 9 comments
Labels
C: VExpansionPanels VExpansionPanels T: feature A new feature wontfix The issue is expected and will not be fixed

Comments

@beerwin
Copy link

beerwin commented Nov 15, 2019

Problem to solve

We have some designs where the icon is on the left side of the expansion header title.

Proposed solution

An option to place the icon on the left side, just before the header text.

@ghost ghost added the S: triage label Nov 15, 2019
@KaelWD
Copy link
Member

KaelWD commented Nov 15, 2019

You can do this with CSS order or v-expansion-panel-header's default slot.

@KaelWD KaelWD closed this as completed Nov 15, 2019
@KaelWD KaelWD added C: VExpansionPanels VExpansionPanels T: feature A new feature wontfix The issue is expected and will not be fixed and removed S: triage labels Nov 15, 2019
@roblugt
Copy link
Contributor

roblugt commented Jan 27, 2020

Shame this has been closed; we need this functionality too and the closure comment does not really give sufficient signposting to a workable solution.

@johngoben-righteye
Copy link

johngoben-righteye commented May 13, 2020

I agree that the closure comment did not have significant sign posting for a workable solution. I did manage to figure out a solution using order as a clue.

<template>
	<v-expansion-panel-header>
	    <template v-slot:actions>
	        <v-icon class="icon">$expand</v-icon>
	    </template>
	    <span class="header">{{ headerText }}</span>
	</v-expansion-panel-header>
</template>

<style>
	.icon {
	    order: 0;
	}

	.header {
	    order: 1;
	}
</style>

@ogmo0n
Copy link

ogmo0n commented May 14, 2020

How about if I need the default chevron icon on the right and a custom icon on the left of the header?

@ogmo0n
Copy link

ogmo0n commented May 14, 2020

Never mind - I nested my icon within the v-expansion-panel-header and achieved what I was going for

@arsh13
Copy link

arsh13 commented Jul 17, 2020

I agree that the closure comment did not have significant sign posting for a workable solution. I did manage to figure out a solution using order as a clue.

<template>
	<v-expansion-panel-header>
	    <template v-slot:actions>
	        <v-icon class="icon">$expand</v-icon>
	    </template>
	    <span class="header">{{ headerText }}</span>
	</v-expansion-panel-header>
</template>

<style>
	.icon {
	    order: 0;
	}

	.header {
	    order: 1;
	}
</style>

I was stuck at the same thing today. There's no documentation about how to shift icons to the left too.
Thanks @johngoben-righteye, your solution saved a lot of my efforts.

@surajsharmadev
Copy link

.v-expansion-panel-header {
display: flex;
flex-direction: row;
justify-content: space-between;
}

@RoboVij
Copy link

RoboVij commented Nov 2, 2022

A workaround: https://stackoverflow.com/a/72444901

@beerwin
Copy link
Author

beerwin commented Nov 23, 2022

Having to resort to CSS hacks kinda defeats the purpose of using a styled component. At the other end @RoboVij's solution works well (abusing the default slot). I think that workaround could be added to the documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C: VExpansionPanels VExpansionPanels T: feature A new feature wontfix The issue is expected and will not be fixed
Projects
None yet
Development

No branches or pull requests

8 participants