-
Notifications
You must be signed in to change notification settings - Fork 9
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
textInput pass 3 - adding some styling for background, fix cursor \n issue, and some more cleanup #578
Conversation
Signed-off-by: hanbollar <[email protected]>
Your Render PR Server URL is https://examples-mrjs-pr-578.onrender.com. Follow its progress at https://dashboard.render.com/static/srv-cobd4r8cmk4c73fnfdsg. |
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
pausing on this for a short bit |
todos:
|
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
if all is good - then this is enough to re-expose this as a tag and in documentation repo with future issues created off of this for more work |
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
future niceties include:
i'll make individual issues off of these once this pr is merged for easier tracking |
Signed-off-by: hanbollar <[email protected]>
Screen.Recording.2024-04-12.at.4.48.06.PM.mov |
Still looking at the code but the cursor seems a little higher than it should be. Also did you test with other font sizes? |
redo: i had misinterpretated your cursor statement --> actual response:
and yea had tested with other font sizes - it doesnt scale exactly as i want atm, but it does at least start at the right top and width position - was leaving that as a future noodle to not be a blocker on this one |
document.body.appendChild(inputElement); // Ensure it's part of the DOM for event capturing | ||
|
||
// Ensure it's part of the DOM for event capturing | ||
document.body.appendChild(inputElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we talked about this but why aren't we putting this in the shadow root? might scale a little better. especially for embedded experiences.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh no main reason - i can swap it to that
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah it shouldn't be a huge issue and then you wouldn't need to do the 9999999/-99999999 absolute positions. you can just set it to display:none
in CSS.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that is so much cleaner haha
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah use this as an example #578 (comment)
It's one of those stack overflow tricks I picked up the first time I was trying with MRTextField.
this.lineHeight = 1.2; // Default line height, can be adjusted as needed | ||
this.object3D.name = 'textField'; | ||
|
||
// this.wrapper = this.shadowRoot.appendChild(document.createElement('div')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Related to my other comment. why a hidden field in the DOM instead of an actual field in the shadow?
@@ -73,7 +107,7 @@ export class MRTextFieldEntity extends MRTextInputEntity { | |||
|
|||
// Ensure the cursor position is updated to reflect the current caret position | |||
setTimeout(() => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what's this for?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if we end up needing to pass the event info/etc to the function within that, we want the timeout to have a delay s.t. the event actually holds all the proper information (since it's a press/trigger type one) otherwise, the events can get delayed so the next time you grab the info, you're grabbing the previous version until the next event gets called (it's like the stack gets delayed by one or more steps if that makes sense)
tldr atm this setup is no longer needed since i dont pass the 'event' object to the cursor function anymore, but if we ever do it again, it will be needed with something > 0
^ given this, lmk if you'd want it removed or kept just in case
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd say if we're not using it we can lose it for the sake of cleanliness
Overall it's pretty solid. I don't think you're blocking anything ATM so try and make the Shadow DOM changes we discussed. Some notes for what I think we need by v1:
|
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
Signed-off-by: hanbollar <[email protected]>
No blocker but let's prioritize it on the next pass. Good work! |
Linking
related to #513
pass1 was #524, pass2 was #546
all the rest of this section of the pr description is the same as in the #524 / #546 prs
Required to Merge
@lobau
@hanbollar