Skip to content
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

input value will disappear by calling fragments #35

Closed
rzfang opened this issue Apr 12, 2022 · 4 comments
Closed

input value will disappear by calling fragments #35

rzfang opened this issue Apr 12, 2022 · 4 comments
Assignees

Comments

@rzfang
Copy link

rzfang commented Apr 12, 2022

Environment

Linux Mint 20.3 Cinnamon
[email protected]
[email protected]
@riotjs/[email protected]

Steps to reproduce the problem.

Can not find any platform which can run ssr, so I paste code here.

file - test.riot.js

export default {
  css: null,
  exports: null,

  template: (
    template,
    expressionTypes,
    bindingTypes,
    getComponent
  ) => template(
    '<input type="button" value="GJ"/>',
    []
  ),

  name: 'test'
};

file - test.js

import ssr from '@riotjs/ssr';
import test from './test.riot.js';

const { html: HTML, css: CSS } = ssr.fragments('test', test, {});

console.log(HTML);

test.js output - the value becomes empty.

<test><input type="button" value=""></test>
@GianlucaGuarini GianlucaGuarini self-assigned this Apr 25, 2022
@rzfang
Copy link
Author

rzfang commented May 2, 2022

It looks like that input[type=radio] has the same issue:
<input type='radio' value='test'/> becomes <input type='radio' value=''/>

BUT, this is workable:
<input type='radio' value={'test'}/>

@GianlucaGuarini
Copy link
Member

I will need to investigate it. For now you can simply use <input value={'your-value'}/>. That should work.

@GianlucaGuarini
Copy link
Member

Fixed in @riotjs/[email protected] thank you for reporting it

@rzfang
Copy link
Author

rzfang commented May 14, 2022

Verified, the issue gone.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants