Skip to content

Commit aff687b

Browse files
author
Janith Rathnayaka
committed
fix indicator list hover
1 parent afa82d5 commit aff687b

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

ui/components/indicator-list.tsx

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -191,17 +191,22 @@ const Indicator = ({
191191
if (!isNaN(number)) {
192192
return number;
193193
}
194-
if (indicator.raw_data_col.length > 3) {
194+
const cleanedData = indicator.raw_data_col.replace(/^["']+|["']+$/g, '').trim();
195+
196+
if (cleanedData.length > 9) {
197+
// Find the first word
198+
const firstWord = cleanedData.split(' ')[0];
199+
195200
return (
196201
<span
197202
onMouseEnter={() => setIsHovered(true)}
198203
onMouseLeave={() => setIsHovered(false)}
199204
>
200-
{indicator.raw_data_col.substring(0, 3)}...
205+
{firstWord}...
201206
</span>
202207
);
203208
} else {
204-
return indicator.raw_data_col;
209+
return cleanedData;
205210
}
206211
} else {
207212
return hasNoData ? "Data unavailable" : disp_val;
@@ -229,7 +234,7 @@ const Indicator = ({
229234
className={`absolute right-0 text-center bottom-full mb-2 bg-white shadow-lg border border-gray-200 z-50
230235
${getWidthClass()} p-2`}
231236
>
232-
{indicator.raw_data_col}
237+
{indicator.raw_data_col.replace(/^["']+|["']+$/g, '').trim()}
233238
</div>
234239
)}
235240
</span>

0 commit comments

Comments
 (0)