Skip to content

Commit 3e32c58

Browse files
committed
feat: use inputConfiguration.languageCharacters to determine if languageCharactersProps buttons should show up in toolbar PD-4065
1 parent e02536e commit 3e32c58

2 files changed

Lines changed: 9 additions & 2 deletions

File tree

packages/inline-dropdown/configure/src/inline-dropdown-toolbar.jsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ export class RespAreaToolbar extends React.Component {
308308
return null;
309309
}
310310

311+
const responseAreaPluginProps = getPluginProps(responseAreaInputConfiguration?.inputConfiguration, baseInputConfiguration);
312+
311313
return (
312314
<div
313315
className={classes.responseContainer}
@@ -335,7 +337,7 @@ export class RespAreaToolbar extends React.Component {
335337
}}
336338
markup={respAreaMarkup}
337339
onKeyDown={this.onKeyDown}
338-
languageCharactersProps={[{ language: 'spanish' }, { language: 'special' }]}
340+
languageCharactersProps={responseAreaPluginProps.languageCharacters?.disabled ? [] : [{ language: 'spanish' }, { language: 'special' }]}
339341
onChange={(respAreaMarkup) => {
340342
if (this.preventDone) {
341343
return;
@@ -358,7 +360,7 @@ export class RespAreaToolbar extends React.Component {
358360
this.onBlur(e);
359361
}}
360362
placeholder="Add Choice"
361-
pluginProps={getPluginProps(responseAreaInputConfiguration?.inputConfiguration, baseInputConfiguration)}
363+
pluginProps={responseAreaPluginProps}
362364
spellCheck={spellCheck}
363365
uploadSoundSupport={uploadSoundSupport}
364366
mathMlOptions={mathMlOptions}

packages/pie-models/src/pie/ConfigurationProp.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ export interface EditableHtmlConfigureProp {
7979
* Indicates if the h3 plugin is disabled or not
8080
*/
8181
h3?: EditableHtmlButtonConfigure;
82+
83+
/**
84+
* Indicates if the language characters plugins are disabled or not (overwrites configuration.language)
85+
*/
86+
languageCharacters?: EditableHtmlButtonConfigure;
8287
}
8388

8489
export interface EditableHtmlPluginConfigure extends ConfigureProp {

0 commit comments

Comments
 (0)