Browse Source

Scroll the RTE toolbar if the text component is bigger than the view. Closes #1980

pull/2031/head
Artur Arseniev 7 years ago
parent
commit
6ca9d77577
  1. 6
      src/rich_text_editor/index.js
  2. 5
      webpack.config.js

6
src/rich_text_editor/index.js

@ -240,8 +240,12 @@ module.exports = () => {
if (pos) {
if (config.adjustToolbar) {
const frameOffset = canvas.getCanvasView().getFrameOffset();
// Move the toolbar down when the top canvas edge is reached
if (pos.top <= pos.canvasTop) {
if (
pos.top <= pos.canvasTop &&
!(pos.elementHeight + pos.targetHeight >= frameOffset.height)
) {
pos.top = pos.elementTop + pos.elementHeight;
}
}

5
webpack.config.js

@ -40,7 +40,10 @@ module.exports = env => {
plugins: plugins,
mode: isProd ? 'production' : 'development',
devtool: isProd ? 'source-map' : (!env ? 'cheap-module-eval-source-map' : false),
devServer: { headers: { 'Access-Control-Allow-Origin': '*' } },
devServer: {
headers: { 'Access-Control-Allow-Origin': '*' },
disableHostCheck: true,
},
module: {
rules: [{
test: /\/index\.js$/,

Loading…
Cancel
Save