mathlive icon indicating copy to clipboard operation
mathlive copied to clipboard

[FEATURE] API to disable selection

Open DylanXie123 opened this issue 4 years ago • 2 comments

Description

I want to disable selection in math-field, but css property userSelect: 'none' doesn't seems to work with mathlive, I guess mathlive has its own system to handle selection? And I look through the documentation without finding any API to disable selection, I wonder if it's possible to add an API to disable selection.

Steps to Reproduce

React Code Example

import MathView from 'react-math-view'; // just a wrapper to use mathlive in react

function MathKey(content: string) {
  return (
    <MathView
      value={content}
      readOnly={true}
      style={{ userSelect: 'none' }}
    />
  );
}

Actual Behavior

Can still select content when set userSelect: 'none' . untitled

Expected Behavior

An new API to disable selection.

Environment

MathLive version 0.69.4

Operating System Windows10

Browser Chrome

DylanXie123 avatar Aug 17 '21 08:08 DylanXie123

Alternatively, the math-field component should respect the user-select: none property, since that seems the reasonable and intuitive thing to do.

arnog avatar Aug 17 '21 09:08 arnog

Yes, I agree that user-select: none is a better way to do this.

DylanXie123 avatar Aug 18 '21 02:08 DylanXie123

Fixed in mathlive 0.90.0

arnog avatar Mar 20 '23 06:03 arnog