Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Fix form property assignment edge case#35073

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
lunny merged 2 commits intogo-gitea:mainfromwxiaoguang:fix-form-property
Jul 14, 2025

Conversation

@wxiaoguang
Copy link
Contributor

@wxiaoguangwxiaoguang commentedJul 14, 2025
edited
Loading

"form" has an edge case: its<input name=action> element overwrites theaction property, we can only set attribute.

This PR makesassignElementProperty can handle such case, and add more tests

@GiteaBotGiteaBot added the lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelJul 14, 2025
@wxiaoguangwxiaoguang added the backport/v1.24This PR should be backported to Gitea 1.24 labelJul 14, 2025
@wxiaoguangwxiaoguang added this to the1.25.0 milestoneJul 14, 2025
setAttribute:(name:string,value:string)=>void;
}&Record<string,any>

exportfunctionassignElementProperty(el:ElementWithAssignableProperties,kebabName:string,val:string){
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Why notElement orHTMLElement?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Because it needs "any":

Image

Copy link
Member

@silverwindsilverwindJul 14, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Shouldn'tkeyof typeof Element work for the property access?

constcamelizedName:keyoftypeofElement=camelize(kebabName);

Copy link
Member

@silverwindsilverwindJul 14, 2025
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If not, use(el as any)[camelizedName] = ... to assign. Better do dirty stuff within a function than to exposeany to consumers.

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

I don't see a clearer solution.

Feel free to edit this PR directly with your solution.

@GiteaBotGiteaBot added lgtm/need 1This PR needs approval from one additional maintainer to be merged. and removed lgtm/need 2This PR needs two approvals by maintainers to be considered for merging. labelsJul 14, 2025
@GiteaBotGiteaBot added lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore. and removed lgtm/need 1This PR needs approval from one additional maintainer to be merged. labelsJul 14, 2025
@lunnylunny added the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelJul 14, 2025
@lunnylunny merged commit692c90e intogo-gitea:mainJul 14, 2025
26 checks passed
@GiteaBotGiteaBot removed the reviewed/wait-mergeThis pull request is part of the merge queue. It will be merged soon. labelJul 14, 2025
@wxiaoguangwxiaoguang deleted the fix-form-property branchJuly 15, 2025 00:11
GiteaBot pushed a commit to GiteaBot/gitea that referenced this pull requestJul 15, 2025
"form" has an edge case: its `<input name=action>` element overwritesthe `action` property, we can only set attribute.This PR makes `assignElementProperty` can handle such case, and add moretests
@GiteaBotGiteaBot added the backport/doneAll backports for this PR have been created labelJul 15, 2025
wxiaoguang added a commit that referenced this pull requestJul 15, 2025
Backport#35073 by wxiaoguangCo-authored-by: wxiaoguang <wxiaoguang@gmail.com>
zjjhot added a commit to zjjhot/gitea that referenced this pull requestJul 16, 2025
* giteaofficial/main:  Send email on Workflow Run Success/Failure (go-gitea#34982)  [skip ci] Updated translations via Crowdin  Replace `poetry` with `uv` (go-gitea#35084)  nix flake update (go-gitea#35085)  Use monospace font in PR command line instructions (go-gitea#35074)  Add gitignore rules to exclude LLM instruction files (go-gitea#35076)  [skip ci] Updated translations via Crowdin  Fix form property assignment edge case (go-gitea#35073)  Improve submodule relative path handling (go-gitea#35056)  Fixed all grammatical errors in locale_en-US.ini (go-gitea#35053)  UI: add hover background to table rows in user and repo admin page (go-gitea#35072)
@go-giteago-gitea locked asresolvedand limited conversation to collaboratorsOct 13, 2025
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@silverwindsilverwindsilverwind left review comments

@lunnylunnylunny approved these changes

@delvhdelvhdelvh approved these changes

Assignees

No one assigned

Labels

backport/doneAll backports for this PR have been createdbackport/v1.24This PR should be backported to Gitea 1.24lgtm/doneThis PR has enough approvals to get merged. There are no important open reservations anymore.modifies/frontend

Projects

None yet

Milestone

1.25.0

Development

Successfully merging this pull request may close these issues.

5 participants

@wxiaoguang@lunny@silverwind@delvh@GiteaBot

[8]ページ先頭

©2009-2025 Movatter.jp