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]);
|
||||
|
||||
const handleChange = (e: ChangeEvent<HTMLInputElement>): void => {
|
||||
setCurrentVal(e.target?.value);
|
||||
const handleLabelChange = (event: ChangeEvent<HTMLInputElement>): void => {
|
||||
setCurrentVal(event.target?.value.replace(':', ''));
|
||||
};
|
||||
|
||||
const handleClose = (key: string): void => {
|
||||
@ -133,9 +133,9 @@ function LabelSelect({
|
||||
<div style={{ display: 'flex', width: '100%' }}>
|
||||
<Input
|
||||
placeholder={renderPlaceholder()}
|
||||
onChange={handleChange}
|
||||
onChange={handleLabelChange}
|
||||
onKeyUp={(e): void => {
|
||||
if (e.key === 'Enter' || e.code === 'Enter') {
|
||||
if (e.key === 'Enter' || e.code === 'Enter' || e.key === ':') {
|
||||
send('NEXT');
|
||||
}
|
||||
}}
|
||||
|
Loading…
x
Reference in New Issue
Block a user