Skip to content
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .changeset/nine-flowers-hunt.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
'@storefront-ui/react': patch
'@storefront-ui/vue': patch
---

Format SfSelect component, removal of extra unecessary lines
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,12 @@ export default function SfSelect(props: SfSelectProps) {
...attributes
} = props;
const { isFocusVisible } = useFocusVisible();

const [chevronRotated, setChevronRotated] = useState(false);

const rotateUp = () => setChevronRotated(true);

const rotateDown = () => setChevronRotated(false);

const keydownHandler = (event: KeyboardEvent<HTMLSelectElement>) => {
if (event.code === 'Space') {
rotateUp();
}
if (event.code === 'Space') rotateUp();
};

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,16 @@ const props = defineProps({
default: '',
},
});

const selected = ref(props.value);
const chevronRotated = ref(false);
const emit = defineEmits<{
(event: 'update:modelValue', param: string): void;
}>();

const selected = ref(props.value);
const chevronRotated = ref(false);
const { isFocusVisible } = useFocusVisible();

const clickHandler = () => (chevronRotated.value = true);

const blurHandler = () => (chevronRotated.value = false);

const keydownHandler = () => (chevronRotated.value = true);

const changedValue = (event: Event) => {
Expand Down