Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use format* beforeInput types across the features #8000

Closed
oleq opened this issue Sep 2, 2020 · 2 comments
Closed

Use format* beforeInput types across the features #8000

oleq opened this issue Sep 2, 2020 · 2 comments
Labels
domain:dx This issue reports a developer experience problem or possible improvement. domain:ui/ux This issue reports a problem related to UI or UX. package:alignment package:basic-styles package:font package:indent package:typing resolution:expired This issue was closed due to lack of feedback. squad:core Issue to be handled by the Core team. status:stale type:task This issue reports a chore (non-production change) and other types of "todos".

Comments

@oleq
Copy link
Member

oleq commented Sep 2, 2020

Provide a description of the task

There are various beforeInput types that help integrate editor with native UI/OS controls (like the native WYSIWYG toolbar in iOS). There are events like

  • formatBold,
  • formatItalic,
  • formatUnderline,
  • formatStrikeThrough,
  • formatSuperscript,
  • formatSubscript,
  • formatJustifyFull,
  • formatJustifyCenter,
  • formatJustifyRight,
  • formatJustifyLeft,
  • formatIndent,
  • formatOutdent,
  • formatRemove,
  • formatBackColor (to be researched),
  • formatFontColor (to be researched),
  • formatFontName (to be researched)

that should be handled in individual features, for instance,

editor.editing.view.document.on( 'beforeinput', ( evt, data ) => {
	const domEvent = data.domEvent;

	if ( domEvent.inputType === 'formatBold' ) {
		editor.execute( 'bold' );

		evt.stop();
		data.preventDefault();
	}
} );

Even though some event types are virtual at this moment (they exist in the spec only), the integration is very cheap so we could cover them all to stay safe in the future.

@oleq oleq added the type:task This issue reports a chore (non-production change) and other types of "todos". label Sep 2, 2020
@oleq oleq added domain:dx This issue reports a developer experience problem or possible improvement. domain:ui/ux This issue reports a problem related to UI or UX. package:typing package:alignment package:basic-styles package:font package:indent labels Sep 3, 2020
@Reinmar Reinmar mentioned this issue Sep 3, 2020
13 tasks
@oleq oleq added this to the iteration 36 milestone Sep 3, 2020
@oleq oleq added the squad:dx label Sep 3, 2020
@Reinmar Reinmar modified the milestones: iteration 36, iteration 37 Sep 28, 2020
@Reinmar Reinmar modified the milestones: iteration 37, nice-to-have Oct 14, 2020
@Reinmar Reinmar added the squad:core Issue to be handled by the Core team. label Sep 9, 2021
@Reinmar Reinmar removed the squad:dx label Sep 27, 2021
@pomek pomek removed this from the nice-to-have milestone Feb 21, 2022
@CKEditorBot
Copy link
Collaborator

There has been no activity on this issue for the past year. We've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

@CKEditorBot
Copy link
Collaborator

We've closed your issue due to inactivity over the last year. We understand that the issue may still be relevant. If so, feel free to open a new one (and link this issue to it).

@CKEditorBot CKEditorBot added the resolution:expired This issue was closed due to lack of feedback. label Nov 12, 2023
@CKEditorBot CKEditorBot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:dx This issue reports a developer experience problem or possible improvement. domain:ui/ux This issue reports a problem related to UI or UX. package:alignment package:basic-styles package:font package:indent package:typing resolution:expired This issue was closed due to lack of feedback. squad:core Issue to be handled by the Core team. status:stale type:task This issue reports a chore (non-production change) and other types of "todos".
Projects
None yet
Development

No branches or pull requests

4 participants