Skip to content

Commit

Permalink
fix: format SfSelect component (#2747)
Browse files Browse the repository at this point in the history
  • Loading branch information
Szymon-dziewonski committed May 26, 2023
1 parent 5b9573c commit 0ab7b39
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 11 deletions.
6 changes: 6 additions & 0 deletions .changeset/nine-flowers-hunt.md
@@ -0,0 +1,6 @@
---
'@storefront-ui/react': patch
'@storefront-ui/vue': patch
---

Format SfSelect component, removal of extra unecessary lines
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
8 changes: 3 additions & 5 deletions packages/sfui/frameworks/vue/components/SfSelect/SfSelect.vue
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

0 comments on commit 0ab7b39

Please sign in to comment.