Skip to content

Commit

Permalink
fix: error when double-click a plain text
Browse files Browse the repository at this point in the history
Only on generic and froala
  • Loading branch information
xjiang-at-wiris authored and carla-at-wiris committed Mar 11, 2024
1 parent 99e59fe commit 223ad38
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 18 deletions.
5 changes: 3 additions & 2 deletions .github/workflows/deploy-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 16

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
Expand Down Expand Up @@ -151,7 +151,7 @@ jobs:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version: 18
node-version: 16

- name: Create environment.prod.ts file
run: node scripts/createEnvFile.js
Expand All @@ -173,6 +173,7 @@ jobs:
REACT_APP_FROALA_API_KEY: ${{ secrets.FROALA_API_KEY }}
NODE_OPTIONS: "--openssl-legacy-provider"
run: |
unset NODE_OPTIONS
npm set "//registry.npmjs.org/:_authToken" ${{ secrets.NPM_TOKEN }}
yarn
yarn nx build ${{ matrix.editor }}
Expand Down
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Last release of this project was 5th of February 2024.
### Unreleased
- fix: Error when open a plain text with MT/CT editor. #KB-44250
- feat: Add version text on html-viewer window property. #KB-43186
- fix: Error when double-click a plain text and open MT/CT editor. #KB-44249

### 8.8.2 2024-02-05

Expand Down
2 changes: 1 addition & 1 deletion packages/devkit/src/integrationmodel.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ export default class IntegrationModel {
/**
* Specify if editor will open in hand mode only
*/
this.forcedHandMode = integrationModelProperties?.integrationParameters.forcedHandMode ?? false;
this.forcedHandMode = integrationModelProperties?.integrationParameters?.forcedHandMode ?? false;

/**
* Indicates if an image is selected. Needed to resize the image to the original size in case
Expand Down
6 changes: 0 additions & 6 deletions packages/froala/wiris.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,12 +183,6 @@ export class FroalaIntegration extends IntegrationModel {
return;
}

// Save a image to a temporal register to detect when we want to
// change between MT and CT.
// Will be deleted when inserting the formula or canceling it
// When double clicking a word, Froala assigns the whole div that contains that word to `element`.
// We only really want temporalImage to be an img element, not divs:
this.core.editionProperties.temporalImage = element.tagName.toLowerCase() === 'img' ? element : null;
super.doubleClickHandler(element);
}

Expand Down
9 changes: 0 additions & 9 deletions packages/generic/wirisplugin-generic.src.js
Original file line number Diff line number Diff line change
Expand Up @@ -252,15 +252,6 @@ export default class GenericIntegration extends IntegrationModel {
}
}

/**
* @inheritdoc
* @param {HTMLElement} element - DOM object target.
*/
doubleClickHandler(element) {
this.core.editionProperties.temporalImage = element;
super.doubleClickHandler(element);
}

/** @inheritdoc */
openNewFormulaEditor() {
this.core.editionProperties.dbclick = false;
Expand Down

0 comments on commit 223ad38

Please sign in to comment.