Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

## Unreleased

- New links now default to the first available link type option (usually “Entry”). ([#550](https://github.com/craftcms/ckeditor/pull/550))
- Fixed a bug where invisible characters were being stripped out of field contents. ([#537](https://github.com/craftcms/ckeditor/issues/537))
- Fixed a bug where Link modals had empty Site menus when no element was selected. ([#534](https://github.com/craftcms/ckeditor/discussions/534), [#545](https://github.com/craftcms/ckeditor/issues/545))

Expand Down
2 changes: 1 addition & 1 deletion src/web/assets/ckeditor/dist/ckeditor5-craftcms.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 8 additions & 1 deletion src/web/assets/ckeditor/src/link/linkui.js
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,14 @@ export default class CraftLinkUI extends Plugin {
this.linkTypeDropdownItemModels[elementRefHandle].linkOption,
);
} else {
this._showLinkTypeForm('default');
// if we don't have elementRefHandle and the input value is actually empty
// default to showing the first option from the linkOptions menu (e.g. Entry)
if (this._urlInputValue().length == 0) {
this._selectLinkTypeDropdownItem(this.linkOptions[0].refHandle);
this._showLinkTypeForm(this.linkOptions[0]);
} else {
this._showLinkTypeForm('default');
}
}
});

Expand Down
Loading