Skip to content

Fix trailing slash removed while typing#9316

Open
PikachuEXE wants to merge 2 commits into
FreeTubeApp:developmentfrom
PikachuEXE:fix/auto-trailing-slash-removal
Open

Fix trailing slash removed while typing#9316
PikachuEXE wants to merge 2 commits into
FreeTubeApp:developmentfrom
PikachuEXE:fix/auto-trailing-slash-removal

Conversation

@PikachuEXE

@PikachuEXE PikachuEXE commented Jun 23, 2026

Copy link
Copy Markdown
Member

Pull Request Type

  • Bugfix
  • Feature Implementation
  • Documentation
  • Other

Related issue

Better version of #3776
If this works can do the same for #8228
Closes #8228

Description

FT was updating value on typing (even with debounce)
So this PR updates on blur (should be typing/pasting ended) instead of input event

Screenshots

Test yourself to be accurate~

Testing

#3303 (comment)

Desktop

  • OS:
  • OS Version:
  • FreeTube version:

Additional context

Draft coz dunno how to make it also update input value on blur (even it's already committed
Edit 1: Used setText but dunno if that's proper
Edit 2: It seems setText is needed due to if sanitized value is set already (no slash) and slash value is input, the stored value is NOT updated and thus won't make input component to refresh its displayed input data
If a new value is input then the input data is updated

@PikachuEXE PikachuEXE marked this pull request as ready for review June 23, 2026 00:31
@github-actions github-actions Bot added the PR: waiting for review For PRs that are complete, tested, and ready for review label Jun 23, 2026
@FreeTubeBot FreeTubeBot enabled auto-merge (squash) June 23, 2026 00:32
@PikachuEXE PikachuEXE force-pushed the fix/auto-trailing-slash-removal branch from 1bcb7a3 to 39854c7 Compare June 23, 2026 00:39
@PikachuEXE PikachuEXE force-pushed the fix/auto-trailing-slash-removal branch from 94056b4 to 9afbb6e Compare June 23, 2026 00:54
@Shadorc

Shadorc commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

In the Invidious API URL, if I type https:// and click elsewhere, it does nothing has expected, but if I add another / and click elsewhere it leads to https:, is it expected?

@PikachuEXE

Copy link
Copy Markdown
Member Author

I have no idea what to do with those invalid values
The old logic does allow https:// for some reason but that could be due to handling typing issue
I am just fixing the slash removed during typing issue not the invalid value handling issue

@Shadorc

Shadorc commented Jun 23, 2026

Copy link
Copy Markdown
Contributor

Indeed, invalid values handling is probably more #3161 (comment) than #8228
It's cool that the commit is now done on blur, it prevents requesting invalid URLs while the user is typing!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

PR: waiting for review For PRs that are complete, tested, and ready for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: Input fields within the SponsorBlock settings removes character while typing

2 participants