mirror of
https://github.com/maputnik/editor.git
synced 2026-01-08 14:30:00 +00:00
Added inline errors to the code-mirror editors based on field spec.
This commit is contained in:
@@ -358,7 +358,9 @@ export default class App extends React.Component {
|
||||
if (message) {
|
||||
try {
|
||||
const objPath = message.split(":")[0];
|
||||
unset(dirtyMapStyle, objPath);
|
||||
// Errors can be deply nested for example 'layers[0].filter[1][1][0]' we only care upto the property 'layers[0].filter'
|
||||
const unsetPath = objPath.match(/^\S+?\[\d+\]\.[^\[]+/)[0];
|
||||
unset(dirtyMapStyle, unsetPath);
|
||||
}
|
||||
catch (err) {
|
||||
console.warn(err);
|
||||
|
||||
Reference in New Issue
Block a user