1,430 questions
2
votes
2
answers
103
views
how is the ref-safe-context determined in c# when ref assigning to local variables
I am a beginner in C# trying to figure out how ref-safe-context is defined in C#. I declared a function Foo which didn't work since it tries to ref assign a variable with declaration-block to a ref ...
2
votes
2
answers
58
views
Angular CLI 18 do not accept my form nativeElement
I have a simple form and I'm using EmailJS to handle it and I'm sure my IDs and key are correct.
Here's an example of my form:
<form (ngSubmit)="sendEmail(form)" #form="ngForm"&...
4
votes
1
answer
116
views
C#/.NET: why can't I pass ref readonly variable into another method that require ref readonly variable?
Consider this code:
struct Struct { public int Num; }
class Program
{
public void A(ref readonly Struct s) { }
public void B(ref readonly Struct s) => A(ref s);
}
I get a compilation ...
0
votes
1
answer
81
views
How to use NSubstitute with void function and ref argument?
I'm new on C# and NSubstitute - I've been having a rough time trying to mock a avoid function and that it has a ref argument. I've been trying a combination of these docs and these docs (as well as ...
0
votes
2
answers
35
views
Modifying refs in an array
I have a scenario involving a 3rd party component in an array:
let array = [{comp:(<Component/>)},{comp:(<Component/>)},{comp:(<Component/>)}]
array.map((arElem, index) => (
<...
0
votes
0
answers
82
views
In the nim-lang, I want to pass a ref to a read-only tree structure to the spawn'ed nim-taskpool
Sorry for the long message, but I was wondering if you could give me some advice.
What I want to achieve is to handle tree-structured data in the nim language using tasks with the nim-taskpool package....
-1
votes
1
answer
87
views
Is a reference parameter in a static method in a static class in C# .NET thread-safe?
Please consider the following class/method being called from a Blazor page instance class. My question is: if two threads call the MyStaticMethod concurrently passing the same ref int index reference ...
0
votes
0
answers
69
views
PointerToNowhere Exception when validating CRDs using OpenAPI Schema Validator
I have tried creating a schema and validating yaml file structures based on their datatype and I have been constantly getting the same error no matter how I try to resolve it.
The source code where I'...
0
votes
0
answers
41
views
Disabling Form Submit Button Vue3
I would like to disable the submit button in my Vue application if the user hasn't entered data in the donationInput input field. I'm sure I'm missing something basic, thanks for your help identifying ...
0
votes
1
answer
48
views
Reset File Input Refs Across Components to Allow Re-uploading
I only came across very hacky solutions, so maybe someone has a better idea how to solve it.
Here's what I'm trying to do:
The UploadComponent lets the user select files using refs.
Once a file is ...
3
votes
3
answers
132
views
Does accessing a field on a struct returned by ref copy the struct?
Given the method
ref readonly State GetState();
where State is a struct, the following code accesses State.SimTime without copying State:
ref readonly var state = ref GetState();
var t = state....
0
votes
0
answers
31
views
Vue3 Tree with TreeItem component, How to get the parent component using composition API
All the children always equal 100%. This means when I increase one child, all the other children are reduced.
I want to change the slider value manually and by programming
I am using typescript in a ...
2
votes
1
answer
225
views
CS8347/CS8352 with "ref struct" and "in" / "ref" parameter
I have a function with following signature
State MoveForward(in Path path);
Path is a ref struct
State is also a ref struct with just integer.
Now I have another helper function
bool TryMoveForward(...
0
votes
1
answer
147
views
How do you type the refObject of a dynamic tag element in React Typescript?
This issue keeps reoccurring and I always seem to code around it so I'm hoping someone out there can help me shed some light on the correct way to type this.
function MyComponent({ isCondition }): ...
1
vote
1
answer
53
views
Identity checks with ref values in Vue3 not working as expected
This official Vue.js documentation claims that the ref() API in Vue 3 uses getters and setters.
In Vue 3, Proxies are used for reactive objects and getter / setters are used for refs.
This would ...
0
votes
0
answers
50
views
Uncaught TypeError: Cannot read properties of undefined (reading 'refs') in React Js using NX monorepo
Getting this error while closing the modal from closeModal component. I have written path replace using history.push() function.
Ex.
const OnClose = () =>{
history.push({
pathname: "/...
0
votes
0
answers
190
views
Type is not assignable to type UnwrapRef
The below code shows an error on the line
tableItemsOptions.value.search = searchArray
Error:
Type 'Record<string, string | null>' is not assignable to type 'UnwrapRef<Record<keyof T, ...
1
vote
1
answer
183
views
Adding "View More" functionality for truncated long text in Vuetify v-data-table
I am working on a Vuetify 3 data tabe and need to implement a "View More" button for description that exceed three lines. I want to use scrollHeight and clientHeight to determine if the text ...
0
votes
1
answer
85
views
Why ref.value can't access private properties declared with #, but with TypeScript's `private` it can?
I have two classes declared.Goods and User
class Goods {
#price: number
#quantity: number
constructor(price: number, quantity: number) {
this.#price = price;
this.#quantity =...
2
votes
1
answer
134
views
Ideomatic Rust to storing/freeing externally allocated memory as a ref
An external C library allocates/frees memory via FFI. My rust code is a thin wrapper layer called by C, and allows other Rust developers to write safe Rust code without dealing with FFI from C. My ...
0
votes
1
answer
90
views
Ref parameters and async task
First of all, I understand that the ref, in and out parameters are forbidden in asynchronous tasks.
However, as I have this need, I'm trying to find the cleanest, simplest and most effective solution.
...
0
votes
1
answer
114
views
Assign a value by ref to a class member by ref
Something is confusing me, and I hope you can maybe clarify.
// This class assumes that T is definitively compatible to TheStruct
class ValueHolder<T> {
T _value;
TheStruct _structValue;
...
3
votes
1
answer
69
views
Behavior "ref" and "const ref" in Chapel
I am trying to understand the behavior of ref and const ref applied to the members of a composite type (e.g. record). Here, is it OK to assume that the behavior of them is similar to auto& and ...
0
votes
1
answer
68
views
How does rust translate a mutable ref to immutable ref in generic traits?
I was trying to implement the From trait for a custom struct in order to build it from a reference to another struct:
struct Base { ...properties }
struct Derived { ...other_properties }
impl From&...
2
votes
1
answer
34
views
touchmove event listener stops firing on mobile when updating a ref, works fine on desktop
I am working on a schedule component in React, the relevant code is available in this code sanbox.
And can be accessed here: https://6rcv9w.csb.app/
As the console logs show the touchmove event stops ...
0
votes
0
answers
72
views
$refs undefined when accessing VueTelInput component
I am working on a Vue.js component that uses the VueTelInput component for phone number input. I am encountering an issue where this.$refs.creationPhoneInput is undefined:
<template>
<...
0
votes
1
answer
102
views
How to disable next button of the vue-form-wizard? or override it with custom button and hide only the next button
I am new to vue js, I am using this vue-form-wizard and I am not sure if there is a way to disable the next button by some conditions, so depends on the conditions will enable or disable the button
&...
0
votes
1
answer
501
views
Are there any issues/concerns with assigning computed values to a ref property in Vue?
I'm reviewing some Vue code where the developer has assigned a computed value to a ref property. I've never seen this done before, and although it works, it seems odd to me.
Are there any potential ...
0
votes
0
answers
122
views
Expression produces a union type that is too complex to represent.ts
I am creating a react component that creates a custom html element and sets innerhtml using dangerouslySetInnerHTML, everything goes fine but the issue arises when I provide the dynamic type to the ...
2
votes
0
answers
147
views
querySelector does not work as expected in Vue components
I'm new to vue.js and I've encountered a problem that I can't fix.
In my SelectField.vue component I have written the following method:
getModalBodyElement() {
return document.querySelector('....
0
votes
1
answer
183
views
How Vue3 @/v-on event function passing work?
<input type="file"
id="fieldBoxContentAddPhoto"
accept="image/png"
@input="inputPhoto(this,fieldBoxContentAddPhoto2,fieldBoxContentAddPhoto3)"
>
<...
1
vote
2
answers
983
views
Difference Between useMemo and useEffect With Ref Dependencies
In React, both useEffect and useMemo have a dependencies argument.
I naively thought they worked identically: whenever the values in that dependencies argument changed, I thought the useEffect or ...
1
vote
1
answer
330
views
why ref does not get value in conditional rendering
i have a component which renders conditionally and i pass a ref to it via forwardRef of React ,but when condition met and component renders, the ref still has not any value,
what should i do?
here is ...
1
vote
1
answer
91
views
Cannot read properties of null/undefined when fetching deep nested objects
I'm currently fetching an object from an api to my vue frontend. This object has many properties, even deep nested ones. For example a project object:
{
id: 1,
title: "My Project",
...
0
votes
1
answer
186
views
Function components cannot be given refs. MUI v5 Autocomplete
i'm trying to use custom component for ListboxComponent prop in Autocomplete MUI v5, but i'm getting this error:
Function components cannot be given refs. Attempts to access this ref will fail. Did ...
1
vote
1
answer
213
views
Rust Arc pointer comparison fails despite same memory address
In Rust, I'm trying to make a group of objects that can be related to one another in a sort of target/dependency chain. I figured I could use a trait and, for each object, assign a "target" ...
1
vote
1
answer
202
views
When is it recommented NOT to use Eigen::Ref for parameters?
I'm currently writing a lot of functions that accept blocks and expressions as input. I generally find it much easier to work with Refs, as they are simple, lightweight, and it's also easy to ensure ...
3
votes
0
answers
80
views
How to get loaded ref array on the first component load
I'm having some issues updating a reactive object in a Vue.js 3 project. I'm creating an array of google.maps.marker.AdvancedMarkerElement, and I'm creating the array like this:
localizaciones.forEach(...
1
vote
1
answer
298
views
ref not available in HTMLAttributes<HTMLDivElement>
I have a reusable wrapper component which like this:
import { FC, HTMLAttributes } from "react";
const Wrapper: FC<HTMLAttributes<HTMLDivElement>> = ({
children,
className,
...
0
votes
2
answers
72
views
How to check attributes of a ref column in the table that is being updated - Oracle
I'm very new to Oracle and struggling with REF's.
I have an employee type with the following structure:
CREATE TYPE person_type AS OBJECT(
address at_address_type,
name at_name_type,
...
0
votes
0
answers
177
views
ref.current.contains(event.target) always returns false
I have a component like this:
const ColumnTaskPrompt = () => {
const promptRef = useRef<HTMLDivElement>(null);
useClickOutside(promptRef, () => {
console.log("do something";...
0
votes
2
answers
2k
views
how to use both ref and v -for in my custom component in Vue 3?
I have field validation and during submit I need to focus on the First input field which has errors
from my parent component CustomForm I can't access my child component input in CustomInput
<...
1
vote
0
answers
916
views
Why does latex give me (??) when I try to reference a figure using \ref{}?
I have tried everything. When I run this in overleaf I get (??) but I'm also able to click the (??) to get to the figure in my pdf so clearly the machine understands what I'm referencing but it doesn'...
0
votes
3
answers
289
views
React using refs to scroll to when selecting from a dropdown
Ok, I am trying to create a dropdown and when selecting an item, the page should scroll to a specific section (ref).
I have several divs with the same ref (as I have more than 30 divs that require a ...
0
votes
1
answer
123
views
How can I dynamically determine height of a conditionally rendered component?
I have a component that is conditionally rendered and i don't know the height of it beforehand (and also would like to avoid setting it manually). It should automatically be equal to the size of its ...
0
votes
1
answer
1k
views
What is the max C# version a source generator library can target?
Source generators should target .NET Standard 2.0. This is the last .NET Standard version that supports .NET Framework. The default C# version in latest .NET Framework releases is C# 7.3.
Suppose a ...
0
votes
1
answer
53
views
UI moves when I put a ref in a Box/div
I have the following code:
and it looks like this:
I need to add a div with a reference inside it:
And if I do so, all the UI moves up. See this picture:
I realized this happens only when I add ...
0
votes
2
answers
188
views
How to have checkboxes checked by default using useFormik?
I have these components and I have 12 checkboxes in child component. I want to have them checked by default when the component loads. I can't do that. I can't use checked='true' as an attribute for my ...
0
votes
0
answers
45
views
Why is there two implementations of ref in react? [duplicate]
There are two variants of ref usage in react:
ref object:
const CustomInput = () => {
const ref = useRef();
return <input ref={ref} />
}
and callback ref:
const CustomInput = () => {
...
0
votes
1
answer
1k
views
Row Echelon form of matrix using python coding without using any inbuilt functions
I'm trying to write a code for the row Echelon form of \ matrix using Python without using any inbuilt functions. But I'm getting an error for last column.
A=[[1,2,3],[4,5,6],[7,8,9]]
j=0;k=0
print(&...