Comments (10)
Actually, what we see is just our own warning...
But in general this is a undesired situation.
ATM, we trigger surface selection rerendering from within the text-property component after rendering, which works.
However, maybe there is a better solution?
from lens.
I still don't understand the situation, i was poking in the code but could not find the environment that causes that warning. Where is this triggered in the component? i guess that's a textproperty component thing?
from lens.
Ok, I think i got it now. Somehow it would be nice when the textproperty knows nothing about selection rerenderings. So i would tend to remove that explicit call there? Instead maybe in Surface._setModelSelection we should make a setTimeout this.rerenderDomSelection, so we make sure the ui is up to date?
Just as a general idea.. i'm probably overlooking something...
from lens.
Pls review: substance/substance@cfc7300
I think we should inverse the control and let only the surface call rerenderDOMSelection but give it a change to know when this is necessary. E.g. when some text texproperty has been updated, but then only if the selection is affected there should be a rerender dom selection.
from lens.
Do you see the warning on the console?
You can click on the location link... then u know where it is done.
from lens.
Sorry... last comment was probably not up2date anymore.
from lens.
Yeah... the timeout thing we used to do before.
I suppose it is as good as any solution could be... considering concurrent situations where u type rapidly
the pure fact of render being async could possibly cause troubles...
But I think this is not a real problem for us, as the only situation where we pull the selection from DOM is after cursor navigation and mouse click.
During typing we just rerender and maybe causing a wrong cursor for a tiny bit of a second.
from lens.
And hopefully the async render is more like setTimeout(0), otherwise we would have to delay longer.
from lens.
Yeah we need to investigate that a bit more.. but i'm relatively certain it's the setTimeout(0) thing.
Maybe we could describe the rerender necessity in a condition. E.g. the surface could listen to document changes and determine wether a selection rerender is necessary or not.
Not sure how hard it is to implement such a checker generically:
selectionIsAffectedByDocChange(docChange, sel) {}
from lens.
We don't do rerender from TextProperty anymore... instead Surface.rerenderSomSelectin() does it delayed.
Seems to work.
from lens.
Related Issues (20)
- When a cursor moves into a reference, it can't move out of it anymore HOT 2
- npm install fails on 'fix-lens-#96' HOT 1
- Figure insert before existing figures doesn't change figure numbers HOT 1
- Using cite after selecting a block of text replaces the entire text HOT 2
- Copy-pasting rich text within the document is not working
- Use self-hosted iframely service
- ScrollTo is not accurate anymore HOT 1
- Fix updating of citation targets HOT 1
- Overcome missing Node lifecycle hooks
- JATS Import/Export HOT 15
- Fix bib item panel styles HOT 1
- Embed import/export not working properly
- Citation labels are not computed correctly.
- When cut'n'pasting a figure, figure citation labels get screwed.
- Read mode is broken? HOT 1
- Search bib ref not enabled?
- Abstract is missing from the saved XML
- Undo does not re-enable save button
- Inserting an image fails silently HOT 1
- Using left, right arrow keys to navigate text around citations messes things up HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lens.