Use encoding custom atom labels to check molecule edition
Current we check if the molecule was edited by using idCode. However this does not include the custom labels. This means that if they are changed we consider no changes ...
Before edition / after edition the canonized idCode with custom label should be compared
https://cheminfo.github.io/openchemlib-js/classes/Canonizer.html
Code should be something like:
const canonizer = new Canonizer(molecule, {encodeAtomCustomLabels: true});
const idCode = canonizer.getIDCode();
@lpatiny
The issue is that the onChange callback is not triggered in the CanvasMoleculeEditor component from react-ocl.
Current we check if the molecule was edited by using idCode.
This is wrong. We use molfile v3000 (and we don't check if it changed): https://github.com/cheminfo/nmrium/blob/776deabbee26425d4316414eea5dea232acafbfd/src/component/modal/MoleculeStructureEditorModal.tsx#L56-L62
I updated OCL in https://github.com/cheminfo/nmrium/pull/3805, but unfortunately, your example is not fixed by it. We still don't get any event when you change the carbon like that with the keyboard.