Skip to content

Commit

Permalink
Fix primefaces#6340: MeterGroup minor refactor similar to other compo…
Browse files Browse the repository at this point in the history
…nents
  • Loading branch information
melloware committed Apr 9, 2024
1 parent b48c0dc commit 5175b42
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions components/lib/metergroup/MeterGroup.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { useContext } from 'react';
import { useMergeProps } from '../hooks/Hooks';
import * as React from 'react';
import { PrimeReactContext } from '../api/Api';
import { DomHandler, ObjectUtils, classNames } from '../utils/Utils';
import { MeterGroupBase } from './MeterGroupBase';
import { useHandleStyle } from '../componentbase/ComponentBase';
import { useMergeProps } from '../hooks/Hooks';
import { ObjectUtils, classNames } from '../utils/Utils';
import { MeterGroupBase } from './MeterGroupBase';

export const MeterGroup = (inProps) => {
const context = useContext(PrimeReactContext);
const context = React.useContext(PrimeReactContext);
const props = MeterGroupBase.getProps(inProps, context);
const { values, min, max, orientation, labelPosition, start, end, meter, labelList } = props;

Expand Down Expand Up @@ -146,7 +146,8 @@ export const MeterGroup = (inProps) => {
values
};

const labelElement = ObjectUtils.getJSXElement(labelList || createLabelList, { values, totalPercent });
const labelListContent = labelList || createLabelList();
const labelElement = ObjectUtils.getJSXElement(labelListContent, { values, totalPercent });

return (
<div {...rootProps} role="meter" aria-valuemin={min} aria-valuemax={max} aria-valuenow={totalPercent}>
Expand Down

0 comments on commit 5175b42

Please sign in to comment.