(props: AriaMeterProps)
| 32 | * Meters represent a quantity within a known range, or a fractional value. |
| 33 | */ |
| 34 | export function useMeter(props: AriaMeterProps): MeterAria { |
| 35 | let {progressBarProps, labelProps} = useProgressBar(props); |
| 36 | |
| 37 | return { |
| 38 | meterProps: { |
| 39 | ...progressBarProps, |
| 40 | // Use the meter role if available, but fall back to progressbar if not |
| 41 | // Chrome currently falls back from meter automatically, and Firefox |
| 42 | // does not support meter at all. Safari 13+ seems to support meter properly. |
| 43 | // https://bugs.chromium.org/p/chromium/issues/detail?id=944542 |
| 44 | // https://bugzilla.mozilla.org/show_bug.cgi?id=1460378 |
| 45 | role: 'meter progressbar' |
| 46 | }, |
| 47 | labelProps |
| 48 | }; |
| 49 | } |
no test coverage detected