I have a use case where I want to set the contents of a text field or let the user edit the contents of a text field.
Sometimes if the user is typing into the textfield things like quotes get replaced with smart quotes.
If a user wants to set the content of a textfield on an artboard or I want to set the contents of a textfield programmatically and I want to make sure XD does not change it (at all) what must I do? Note: Smart quotes will break my plugin functionality.
Is it possible to tell XD that this field should not try and autocorrect any typed in values?
var textfield = selection.items(0); textfield.disableAutocorrect(true); textfield.content = `Markup: <p color="blue">here's my markup</p>`;
Or on the artboard:
artboard.disableAutocorrect(true); var textfield = selection.items(0); textfield.content = `Markup: <p color="blue">here's my markup</p>`;
Quincy is creating a XD guide plugin that explains all the uses of each object on the artboard. When the plugin is enabled the user selects an object like a rectangle. When this happens the plugin draws a line and a descriptive textfield to the artboard describing the rectangle. When the user selects an ellipse the rectangle description and line is removed and a new line and textfield is added describing the ellipse. Some of the descriptive text contains code samples and other unique non-ascii characters.
As he’s finishing up the plugin he notices some of the text in the text field is being reformatted by XD. He adds a line of code to disable autoformatting on the text field and this fixes it.