mirror of
https://git.mirrors.martin98.com/https://github.com/SigNoz/signoz
synced 2025-09-20 21:23:12 +08:00
fix: create and store label when colon is pressed (#2886)
* fix: create and store label when colon is pressed * fix: use native JS replace * chore: extra value variable is removed --------- Co-authored-by: Palash Gupta <palashgdev@gmail.com>
This commit is contained in:
parent
bb7ea8e8fb
commit
754ba93df9
@ -84,8 +84,8 @@ function LabelSelect({
|
|||||||
handleBlur();
|
handleBlur();
|
||||||
}, [handleBlur]);
|
}, [handleBlur]);
|
||||||
|
|
||||||
const handleChange = (e: ChangeEvent<HTMLInputElement>): void => {
|
const handleLabelChange = (event: ChangeEvent<HTMLInputElement>): void => {
|
||||||
setCurrentVal(e.target?.value);
|
setCurrentVal(event.target?.value.replace(':', ''));
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleClose = (key: string): void => {
|
const handleClose = (key: string): void => {
|
||||||
@ -133,9 +133,9 @@ function LabelSelect({
|
|||||||
<div style={{ display: 'flex', width: '100%' }}>
|
<div style={{ display: 'flex', width: '100%' }}>
|
||||||
<Input
|
<Input
|
||||||
placeholder={renderPlaceholder()}
|
placeholder={renderPlaceholder()}
|
||||||
onChange={handleChange}
|
onChange={handleLabelChange}
|
||||||
onKeyUp={(e): void => {
|
onKeyUp={(e): void => {
|
||||||
if (e.key === 'Enter' || e.code === 'Enter') {
|
if (e.key === 'Enter' || e.code === 'Enter' || e.key === ':') {
|
||||||
send('NEXT');
|
send('NEXT');
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user