Skip to content

Commit

Permalink
Fix label in date and numeric range facets
Browse files Browse the repository at this point in the history
  • Loading branch information
tjmadonna committed Sep 8, 2023
1 parent 1d428c2 commit 31d791b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion components/core/DateRangeFacet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ import { useContext, useEffect, useState } from 'react'
import SearchUIContext from './SearchUIContext'
import styles from '../../css/collapsableFacets.module.css'

const DateRangeFacet = ({ field, label, formatVal }) => {
const DateRangeFacet = ({ field, facet, formatVal }) => {
// default dates
const DEFAULT_MIN_DATE = '1970-01-01'
const DEFAULT_MAX_DATE = '2300-01-01'

const label = facet.label

const { registerFilterChangeCallback, unregisterFilterChangeCallback, getFilter, setFilter, removeFiltersForField, filterExists } = useContext(SearchUIContext)

const [values, setValues] = useState(getValuesFromFilter())
Expand Down
6 changes: 2 additions & 4 deletions components/core/NumericRangeFacet.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import SearchUIContext from './SearchUIContext'
import Slider from '@mui/material/Slider'
import Histogram from './Histogram'

const NumericRangeFacet = ({ field, label, facet }) => {
const NumericRangeFacet = ({ field, facet }) => {
const valueRange = facet.uiRange
const {registerFilterChangeCallback, unregisterFilterChangeCallback, getFilter, setFilter, removeFiltersForField, aggregations } = useContext(SearchUIContext)

Expand Down Expand Up @@ -85,9 +85,7 @@ const NumericRangeFacet = ({ field, label, facet }) => {
onChangeCommitted={handleSliderCommitted}
style={{ color: '#0d6efd' }}
size='small'
getAriaLabel={() => {
label
}}
getAriaLabel={() => { facet.label }}
marks={marks}
value={values}
min={valueRange[0]}
Expand Down

0 comments on commit 31d791b

Please sign in to comment.