Skip to content

Commit

Permalink
Merge branch 'master' of github.com:formio/formio.js into FIO-4112-final
Browse files Browse the repository at this point in the history
  • Loading branch information
travist committed Nov 10, 2023
2 parents 65f56cf + 38f4d53 commit 6cd417d
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
7 changes: 6 additions & 1 deletion Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -206,8 +206,13 @@ Formio.createForm(document.getElementById('formio'), 'https://examples.form.io/e
- FIO 7239: support for AWS S3 Multipart Upload
- FIO-7239: add polyfill and include token in abort and complete requests for multipart upload2
- FIO-7429: removed columns component settings(pull, offset, push)
- FIO-7466: fixed an issue where code inside tolltips will be executed
- FIO-7466: Tooltips fix
- FIO-7355: fixed issue with HTML5 select flickering on initial click
- FIO-7530: added ability to pass onSetItems component setting as a string (needed for builder mode)
- FIO-7528: Revert FIO-4405: fixed an issue where walidation error displays with empty value even if it is not required (#4746)

### Changed
- Add capability for adding sanitize profiles through sanitizeConfig in options

## 5.0.0-rc.26
### Changed
Expand Down
2 changes: 0 additions & 2 deletions src/components/_classes/component/Component.js
Original file line number Diff line number Diff line change
Expand Up @@ -3390,8 +3390,6 @@ export default class Component extends Element {
const rules = [
// Do not validate if the flags say not too.
() => flags.noValidate,
// Do not check custom validation for empty data if it is not required
() => this.component.validate.custom && !this.dataValue && !this.component.validate.required,
// Force valid if component is read-only
() => this.options.readOnly,
// Do not check validations if component is not an input component.
Expand Down
6 changes: 4 additions & 2 deletions src/components/select/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -399,8 +399,10 @@ export default class SelectComponent extends ListComponent {
}

// Allow js processing (needed for form builder)
if (this.component.onSetItems && typeof this.component.onSetItems === 'function') {
const newItems = this.component.onSetItems(this, items);
if (this.component.onSetItems) {
const newItems = typeof this.component.onSetItems === 'function'
? this.component.onSetItems(this, items)
: this.evaluate(this.component.onSetItems, { items: items }, 'items');
if (newItems) {
items = newItems;
}
Expand Down
6 changes: 6 additions & 0 deletions src/utils/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -1304,6 +1304,12 @@ export function sanitize(string, options) {
ADD_ATTR: ['ref', 'target'],
USE_PROFILES: { html: true }
};
// Use profiles
if (options.sanitizeConfig && options.sanitizeConfig.useProfiles) {
Object.keys(options.sanitizeConfig.useProfiles).forEach(key => {
sanitizeOptions.USE_PROFILES[key] = options.sanitizeConfig.useProfiles[key];
});
}
// Add attrs
if (options.sanitizeConfig && Array.isArray(options.sanitizeConfig.addAttr) && options.sanitizeConfig.addAttr.length > 0) {
options.sanitizeConfig.addAttr.forEach((attr) => {
Expand Down

0 comments on commit 6cd417d

Please sign in to comment.