Skip to content

Commit

Permalink
fix: fix search result in rtl mode
Browse files Browse the repository at this point in the history
  • Loading branch information
quanho committed Mar 23, 2023
1 parent e7b1cc7 commit e4f1839
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,7 @@ function RowColumn({ index, rowIndex, columnIndex, style, data }) {
isGridCol={isGridCol}
isSingleSelect={isSingleSelect}
valueTextAlign={valueTextAlign}
direction={direction}
/>
) : (
<Field
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@ import React from 'react';
import CheckboxField from './CheckboxField';
import ValueField from './ValueField';

function LabelsWithRanges({ labels, dense, showGray, checkboxes }) {
function LabelsWithRanges({ labels, dense, showGray, checkboxes, direction }) {
const orderedLabels = direction === 'rtl' ? [...labels].reverse() : labels;
return (
<>
{labels.map(([label, highlighted], index) => {
{orderedLabels.map(([label, highlighted], index) => {
const key = `${index}`;
return (
<ValueField
Expand Down Expand Up @@ -35,8 +36,11 @@ function FieldWithRanges({
isGridCol,
isSingleSelect,
valueTextAlign,
direction,
}) {
const LWR = <LabelsWithRanges labels={labels} dense={dense} showGray={showGray} checkboxes={checkboxes} />;
const LWR = (
<LabelsWithRanges labels={labels} dense={dense} showGray={showGray} checkboxes={checkboxes} direction={direction} />
);
return checkboxes ? (
<CheckboxField
onChange={onChange}
Expand Down

0 comments on commit e4f1839

Please sign in to comment.