Access values from other fields on custom widgets

Let’s say I have a title and a description field and I’d like to display the values inputted on these fields on a custom widget and update it accordingly if these fields values change. Is this possible?

In other words, do I have access to the editor’s form values on a custom widget?

EDIT:
I figured out how to access these fields values, and now I’m trying to discover how to change my custom widget on author and title field change.

This is what I have so far:

const Controller = window.createClass({
  renderWrapper(title, author) {
    const titleElement = window.h('div', null, title);
    const authorElement = window.h('div', null, author);
    return window.h('div', null, [titleElement, authorElement]);
  },

  render() {
    const entry = JSON.parse(JSON.stringify(this.props.entry));

    return window.h(
      'div',
      null,
      this.renderWrapper(entry.data.title, entry.data.author)
    );
  },
});

window.CMS.registerWidget('customField', Controller);

Hi @darksoulsong,

I think the “clean” way to achieve it is to have the custom widget control all relevant values, that is have the widget handle multiple fields/values.

However you can get the other form values with direct access to the browser dom, using the following approach:

const titleInput = document.querySelector('[id*=title-field]');
titleInput.addEventListener('input', (e) => {
  // do something with title
  const title = e.target.value;
});