Closed coleea closed 1 year ago
In your segments
array, you have an object with an update
property:
update : (e) => {console.log("this is triggered. when I call segmentEvt.segment.update");},
This replaces the library's internal Segment.update()
method, which would cause the segment to be redrawn.
The segment should change the label text if you remove this update
property.
thank you @chrisn for your answer.
I already did what you are suggested. in development mode, that works. but when I compile it, type error occurs.
As I know, update property is "required" in typescript options.
So when I delete update function, type error occurs
ts2741 error 2741 : Property is missing in type. So I cannot delete update function.
Is It bug ?
Thank you again.
I see, thank you! There was a bug in the TypeScript declarations. The update
property should not be required.
The fix is available in v3.0.0-beta.8.
@chrisn , thank you very much !
in version v3.0.0-beta.8, this bug is fixed ? I'm still experiencing the same error
It should be fixed, yes, but the type has changed:
const segments: SegmentAddOptions[] = [
{
startTime: 2,
endTime: 5,
labelText: "hello"
}
];
I got it. thank you @chrisn ! everybody should know this.
Thank you, your feedback is really helpful!
version that i use : 3.0.0-beta.7
hi.
I made some code that changes labelText of Segment. details are below.
I expected that labelText of Segment will be changed. but nothing happens.
in console.log, nothing shows. so I can't get any feedback. I don't know about what's wrong?
interesting thing is that update callback function that I wrote in segments array of PeaksOptions is called
What I am missing? Thank you