Skip to content

Commit

Permalink
Spacing
Browse files Browse the repository at this point in the history
  • Loading branch information
nmanu1 committed Oct 27, 2021
1 parent d71c223 commit 74b62d3
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions sample-app/src/components/InputDropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ interface State {
shouldDisplayDropdown: boolean
}

type Action =
type Action =
| { type: 'HideOptions' }
| { type: 'ShowOptions' }
| { type: 'FocusOption', newIndex?: number }

function reducer(state: State, action: Action): State {
switch(action.type) {
case 'HideOptions':
switch (action.type) {
case 'HideOptions':
return { focusedOptionIndex: undefined, shouldDisplayDropdown: false }
case 'ShowOptions':
case 'ShowOptions':
return { focusedOptionIndex: undefined, shouldDisplayDropdown: true }
case 'FocusOption':
case 'FocusOption':
return { focusedOptionIndex: action.newIndex, shouldDisplayDropdown: true }
}
}
Expand All @@ -49,7 +49,7 @@ function reducer(state: State, action: Action): State {
export default function InputDropdown({
inputValue = '',
placeholder,
instructionText='',
instructionText = '',
options,
onSubmit = () => {},
updateInputValue,
Expand All @@ -73,7 +73,7 @@ export default function InputDropdown({
if (inputRef.current.value || options.length || resultsCountRef.current.innerHTML) {
updateResultsCountText();
}

function handleDocumentClick(evt: MouseEvent) {
const target = evt.target as HTMLElement;
if (!target.isSameNode(inputRef.current)) {
Expand Down Expand Up @@ -121,7 +121,7 @@ export default function InputDropdown({
resultsCountRef.current.innerHTML = '';
}
}

function updateResultsCountText() {
if (cssClasses.resultsCount) {
resultsCountRef.current.innerHTML = processTranslation({
Expand Down

0 comments on commit 74b62d3

Please sign in to comment.