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

Increase/Decrease Text Editor Font Size not working #16182

Closed
matthewgasbarro opened this issue Apr 17, 2024 · 3 comments · Fixed by #16261
Closed

Increase/Decrease Text Editor Font Size not working #16182

matthewgasbarro opened this issue Apr 17, 2024 · 3 comments · Fixed by #16261
Assignees
Labels

Comments

@matthewgasbarro
Copy link

Description

Increase/Decrease Text Editor Font Size is not working and is a no-op

Reproduce

  1. Open a Text Editor in either JupyterLab 4 or Notebook 7
  2. Type in some text
  3. Click on Settings -> Increase/Decrease Text Editor Font Size
  4. See that no font resizing occurs

Browser console will show following JavaScript error

Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'fontSize')
    at execute (commands.js:141:77)
    at c.execute (index.es6.js:364:33)
    at p.triggerActiveItem (index.es6.js:6365:27)
    at p._evtMouseUp (index.es6.js:6707:14)
    at p.handleEvent (index.es6.js:6510:22)

chrome_PtBVZmiGKp

Expected behavior

Text should resize accordingly

Context

  • Operating System and version: Windows 10
  • Browser and version: Chrome Version 123
  • JupyterLab version: 4.1.5
  • Notebook version: 7.1.2
@jupyterlab-probot jupyterlab-probot bot added the status:Needs Triage Applied to new issues that need triage label Apr 17, 2024
@krassowski
Copy link
Member

This seems to be coming from this line:

const currentSize =
(config['customStyles']['fontSize'] ??
extensions.baseConfiguration['customStyles']['fontSize']) ||
cssSize;

It was not caught by type checking because config is typed as any:

let config: Record<string, any> = {};

which is another argument for forbidding any (#16038).

And we will need to add a test case for these commands.

@janengcodes
Copy link

Hi, we have been trying to solve this issue. When trying to reproduce the error, we were getting uncaught error saying that fontSize was undefined. However, after adding console.log statement in the code sections referencing fontSize (in commands.ts) we were not able to see any of our console.logs and were wondering if its possible that fontSize is being referenced somewhere else, which is causing the error to be thrown. When trying to trace the error in the console, it was unable to point us to a file. We tried catching the error as well in commands.ts but it had no effect. Are there any other suggestions of where this uncaught error may be originating from?

@krassowski
Copy link
Member

@janengcodes if you did not see the logs, did you check that logs which you add in other places are visible? I would suspect that you are may not be using the compiled dev versions (do you see a red strip/bar at the top of the page?)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants